[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2ae320a-e7ab-94e6-7562-a82e2aad0966@suse.de>
Date: Thu, 7 Mar 2019 13:11:06 +0100
From: Hannes Reinecke <hare@...e.de>
To: YueHaibing <yuehaibing@...wei.com>, jejb@...ux.ibm.com,
martin.petersen@...cle.com
Cc: linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org
Subject: Re: [PATCH -next] scsi: libfc: Fix potential NULL pointer dereference
On 2/27/19 7:09 AM, YueHaibing wrote:
>
> Friendly ping:
>
> Who can review or take this, please?
>
> Thanks
>
> On 2019/1/30 18:11, YueHaibing wrote:
>> There is a potential NULL pointer dereference in case
>> fc_rport_create() fails and returns NULL.
>>
>> Fixes: 2580064b5ec6 ("scsi: libfc: Replace ->rport_create callback with function call")
>> Signed-off-by: YueHaibing <yuehaibing@...wei.com>
>> ---
>> drivers/scsi/libfc/fc_lport.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
>> index ff943f4..e2a3551 100644
>> --- a/drivers/scsi/libfc/fc_lport.c
>> +++ b/drivers/scsi/libfc/fc_lport.c
>> @@ -250,6 +250,10 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
>> }
>> mutex_lock(&lport->disc.disc_mutex);
>> lport->ptp_rdata = fc_rport_create(lport, remote_fid);
>> + if (!lport->ptp_rdata) {
>> + mutex_unlock(&lport->disc.disc_mutex);
>> + return;
>> + }
>> kref_get(&lport->ptp_rdata->kref);
>> lport->ptp_rdata->ids.port_name = remote_wwpn;
>> lport->ptp_rdata->ids.node_name = remote_wwnn;
>>
>
Reviewed-by: Hannes Reinecke <hare@...e.com>
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@...e.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
Powered by blists - more mailing lists