lkml.org 
[lkml]   [2019]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] scsi: libfc: Fix potential NULL pointer dereference
From
Date

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@huawei.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;
>

\
 
 \ /
  Last update: 2019-02-27 07:10    [W:0.058 / U:15.836 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site