diff options
author | YueHaibing <yuehaibing@huawei.com> | 2020-09-09 16:54:32 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-09-16 00:51:39 +0300 |
commit | a9e81c2922bfc4cfe04e33fcbc49ef21e367d7de (patch) | |
tree | c56ac29c646c295c6b4aa25899ac65c9089249df /drivers/scsi/libfc | |
parent | bff8b14b097433c46f142ea8cd8deb910a66d8fc (diff) | |
download | linux-a9e81c2922bfc4cfe04e33fcbc49ef21e367d7de.tar.xz |
scsi: libfc: Fix passing zero to 'PTR_ERR' warning
drivers/scsi/libfc/fc_disc.c:304
fc_disc_error() warn: passing zero to 'PTR_ERR'
fp may be NULL in fc_disc_error(), use PTR_ERR_OR_ZERO to handle this.
Link: https://lore.kernel.org/r/20200909135432.36772-1-yuehaibing@huawei.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r-- | drivers/scsi/libfc/fc_disc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index e67abb184a8a..942fc60f7c21 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -301,8 +301,8 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp) struct fc_lport *lport = fc_disc_lport(disc); unsigned long delay = 0; - FC_DISC_DBG(disc, "Error %ld, retries %d/%d\n", - PTR_ERR(fp), disc->retry_count, + FC_DISC_DBG(disc, "Error %d, retries %d/%d\n", + PTR_ERR_OR_ZERO(fp), disc->retry_count, FC_DISC_RETRY_LIMIT); if (!fp || PTR_ERR(fp) == -FC_EX_TIMEOUT) { |