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: <0efa4731-67d7-fe7a-54ab-a3d3493ad936@huawei.com>
Date:   Mon, 9 Nov 2020 21:11:12 +0800
From:   "yukuai (C)" <yukuai3@...wei.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <madalin.bucur@....com>, <davem@...emloft.net>,
        <florinel.iordache@....com>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <yi.zhang@...wei.com>
Subject: Re: [PATCH V3] fsl/fman: add missing put_devcie() call in
 fman_port_probe()

在 2020/11/08 6:09, Jakub Kicinski 写道:
> On Sat, 7 Nov 2020 17:09:25 +0800 Yu Kuai wrote:
>> if of_find_device_by_node() succeed, fman_port_probe() doesn't have a
>> corresponding put_device(). Thus add jump target to fix the exception
>> handling for this function implementation.
>>
>> Fixes: 0572054617f3 ("fsl/fman: fix dereference null return value")
>> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> 
>> @@ -1792,20 +1792,20 @@ static int fman_port_probe(struct platform_device *of_dev)
>>   	if (!fm_node) {
>>   		dev_err(port->dev, "%s: of_get_parent() failed\n", __func__);
>>   		err = -ENODEV;
>> -		goto return_err;
>> +		goto free_port;
> 
> And now you no longer put port_node if jumping from here...

Sincerely apologize for that stupid mistake...

> 
> Also does the reference to put_device() not have to be released when
> this function succeeds?
> 

I'm not sure about that, since fman_port_driver doesn't define other
interface, maybe it reasonable to release it here.

>>   	}
> 
>> @@ -1896,7 +1895,9 @@ static int fman_port_probe(struct platform_device *of_dev)
>>   
>>   	return 0;
>>   
>> -return_err:
>> +put_device:
>> +	put_device(&fm_pdev->dev);
>> +put_node:
>>   	of_node_put(port_node);
>>   free_port:
>>   	kfree(port);
> 
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ