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  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]
Date:   Thu, 26 Nov 2020 09:17:46 +0800
From:   Qinglang Miao <miaoqinglang@...wei.com>
To:     "Wu, Hao" <hao.wu@...el.com>, Tom Rix <trix@...hat.com>,
        Moritz Fischer <mdf@...nel.org>
CC:     "linux-fpga@...r.kernel.org" <linux-fpga@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fpga: dfl: add missing platform_device_put in
 build_info_create_dev



在 2020/11/25 18:06, Wu, Hao 写道:
>> Subject: [PATCH] fpga: dfl: add missing platform_device_put in
>> build_info_create_dev
>>
>> platform_device_put is missing when it fails to set fdev->id. Set
>> a temp value to do sanity check.
> 
> will this case be covered already by build_info_free()?
> 
> Hao
Yes, you're right Hao.

build_info_create_dev is performed in parse_feature_list which follows
build_info_free.

So please ignore this patch.

Thanks!
> 
>>
>> Fixes: 543be3d8c999 ("fpga: add device feature list support")
>> Reported-by: Hulk Robot <hulkci@...wei.com>
>> Signed-off-by: Qinglang Miao <miaoqinglang@...wei.com>
>> ---
>>   drivers/fpga/dfl.c | 9 ++++++---
>>   1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c
>> index b450870b7..8958f0860 100644
>> --- a/drivers/fpga/dfl.c
>> +++ b/drivers/fpga/dfl.c
>> @@ -877,10 +877,13 @@ build_info_create_dev(struct
>> build_feature_devs_info *binfo,
>>
>>   	INIT_LIST_HEAD(&binfo->sub_features);
>>
>> -	fdev->id = dfl_id_alloc(type, &fdev->dev);
>> -	if (fdev->id < 0)
>> -		return fdev->id;
>> +	int tmp_id = dfl_id_alloc(type, &fdev->dev);
>> +	if (tmp_id < 0) {
>> +		platform_device_put(fdev);
>> +		return tmp_id;
>> +	}
>>
>> +	fdev->id = tmp_id;
>>   	fdev->dev.parent = &binfo->cdev->region->dev;
>>   	fdev->dev.devt = dfl_get_devt(dfl_devs[type].devt_type, fdev->id);
>>
>> --
>> 2.23.0
> 
> .
> 

Powered by blists - more mailing lists