Re: [PATCH -next] hwmon: amd_energy: Missing platform_driver_unregister() on error in amd_energy_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/26/20 7:32 PM, Randy Dunlap wrote:
> On 5/26/20 7:28 PM, Chatradhi, Naveen Krishna wrote:
>> [AMD Official Use Only - Internal Distribution Only]
>>
>> Hi Yongjun,
>>
>> Thanks,
>> Acked-by: Naveen krishna Chatradhi <nchatrad@xxxxxxx>
>>
>> -----Original Message-----
>> From: linux-hwmon-owner@xxxxxxxxxxxxxxx <linux-hwmon-owner@xxxxxxxxxxxxxxx> On Behalf Of Wei Yongjun
>> Sent: Wednesday, May 27, 2020 7:54 AM
>> To: Chatradhi, Naveen Krishna <NaveenKrishna.Chatradhi@xxxxxxx>; Jean Delvare <jdelvare@xxxxxxxx>; Guenter Roeck <linux@xxxxxxxxxxxx>
>> Cc: Wei Yongjun <weiyongjun1@xxxxxxxxxx>; linux-hwmon@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx; Hulk Robot <hulkci@xxxxxxxxxx>
>> Subject: [PATCH -next] hwmon: amd_energy: Missing platform_driver_unregister() on error in amd_energy_init()
>>
>> [CAUTION: External Email]
>>
>> Add the missing platform_driver_unregister() before return from amd_energy_init() in the error handling case.
>>
>> Fixes: 8abee9566b7e ("hwmon: Add amd_energy driver to report energy counters")
>> Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
> 
> Hi Yongjun,
> 
> Does this Reported-by: say (imply) that hulkci is doing semantic analysis?
> 
> Is there any writeup or summary of what hulkci does?
> 
The tag is quite common nowadays.

$ git log | grep "Hulk Robot" | wc
    869    3476   41712

https://lwn.net/Articles/804119/:

"At the top of the "by changesets" column is Yue Haibing, who fixed a large number of small problems
 all over the kernel. The bulk of these problems, it seems, have been found using a system at Huawei
 called Hulk Robot, which uses various Coccinelle scripts and reports the results."

Guenter

>> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
>> ---
>>  drivers/hwmon/amd_energy.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/hwmon/amd_energy.c b/drivers/hwmon/amd_energy.c index bc8b643a37d5..e95b7426106e 100644
>> --- a/drivers/hwmon/amd_energy.c
>> +++ b/drivers/hwmon/amd_energy.c
>> @@ -379,8 +379,10 @@ static int __init amd_energy_init(void)
>>                 return ret;
>>
>>         amd_energy_platdev = platform_device_alloc(DRVNAME, 0);
>> -       if (!amd_energy_platdev)
>> +       if (!amd_energy_platdev) {
>> +               platform_driver_unregister(&amd_energy_driver);
>>                 return -ENOMEM;
>> +       }
>>
>>         ret = platform_device_add(amd_energy_platdev);
>>         if (ret) {
>>
> 
> 
> thanks.
> 




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux