lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ce2f11601c3d2203069487b7bc2364d8@codeaurora.org>
Date:   Thu, 03 Oct 2019 16:44:01 -0700
From:   mnalajal@...eaurora.org
To:     Stephen Boyd <swboyd@...omium.org>
Cc:     gregkh@...uxfoundation.org, rafael@...nel.org,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        bjorn.andersson@...aro.org
Subject: Re: [PATCH] base: soc: Handle custom soc information sysfs entries

On 2019-10-03 16:22, Stephen Boyd wrote:
> Quoting Murali Nalajala (2019-10-02 17:06:14)
>> @@ -121,6 +118,7 @@ static void soc_release(struct device *dev)
>>  struct soc_device *soc_device_register(struct soc_device_attribute 
>> *soc_dev_attr)
>>  {
>>         struct soc_device *soc_dev;
>> +       const struct attribute_group **soc_attr_groups = NULL;
> 
> Don't initialize this to NULL because it is only tested after it's been
> unconditionally assigned to the result of the allocation.
Done
> 
>>         int ret;
>> 
>>         if (!soc_bus_type.p) {
>> @@ -136,10 +134,20 @@ struct soc_device *soc_device_register(struct 
>> soc_device_attribute *soc_dev_attr
>>                 goto out1;
>>         }
>> 
>> +       soc_attr_groups = kzalloc(sizeof(*soc_attr_groups) *
> 
> Please use kcalloc() instead and drop the define for NUM_ATTR_GROUPS
> because it's used once.
> 
done
>> +                                               NUM_ATTR_GROUPS, 
>> GFP_KERNEL);
>> +       if (!soc_attr_groups) {
>> +               ret = -ENOMEM;
>> +               goto out2;
>> +       }
>> +       soc_attr_groups[0] = &soc_attr_group;
>> +       soc_attr_groups[1] = soc_dev_attr->custom_attr_group;
>> +       soc_attr_groups[2] = NULL;
> 
> Drop this assignment to NULL because kzalloc() and kcalloc() zero out
> the memory anyway.
done

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ