* [PATCH] scsi: libfc: pass an error pointer to fc_disc_error()
@ 2017-07-12 7:30 Dan Carpenter
2017-07-12 7:54 ` Johannes Thumshirn
2017-07-12 21:25 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-07-12 7:30 UTC (permalink / raw)
To: Johannes Thumshirn, Robert Love
Cc: James E.J. Bottomley, Martin K. Petersen, fcoe-devel, linux-scsi,
kernel-janitors
This patch is basically to silence a static checker warning.
drivers/scsi/libfc/fc_disc.c:326 fc_disc_error()
warn: passing a valid pointer to 'PTR_ERR'
It doesn't affect runtime because it treats -ENOMEM and a valid pointer
the same. But the documentation says we should be passing an error
pointer.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index fd501f8dbb11..8660f923ace0 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -573,7 +573,7 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
event = DISC_EV_FAILED;
}
if (error)
- fc_disc_error(disc, fp);
+ fc_disc_error(disc, ERR_PTR(error));
else if (event != DISC_EV_NONE)
fc_disc_done(disc, event);
fc_frame_free(fp);
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] scsi: libfc: pass an error pointer to fc_disc_error()
2017-07-12 7:30 [PATCH] scsi: libfc: pass an error pointer to fc_disc_error() Dan Carpenter
@ 2017-07-12 7:54 ` Johannes Thumshirn
2017-07-12 21:25 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2017-07-12 7:54 UTC (permalink / raw)
To: Dan Carpenter
Cc: Johannes Thumshirn, Robert Love, James E.J. Bottomley,
Martin K. Petersen, fcoe-devel, linux-scsi, kernel-janitors
On Wed, Jul 12, 2017 at 10:30:22AM +0300, Dan Carpenter wrote:
> This patch is basically to silence a static checker warning.
>
> drivers/scsi/libfc/fc_disc.c:326 fc_disc_error()
> warn: passing a valid pointer to 'PTR_ERR'
>
> It doesn't affect runtime because it treats -ENOMEM and a valid pointer
> the same. But the documentation says we should be passing an error
> pointer.
Acked-by: Johannes Thumshirn <jth@kernel.org>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: libfc: pass an error pointer to fc_disc_error()
2017-07-12 7:30 [PATCH] scsi: libfc: pass an error pointer to fc_disc_error() Dan Carpenter
2017-07-12 7:54 ` Johannes Thumshirn
@ 2017-07-12 21:25 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2017-07-12 21:25 UTC (permalink / raw)
To: Dan Carpenter
Cc: Johannes Thumshirn, Robert Love, James E.J. Bottomley,
Martin K. Petersen, fcoe-devel, linux-scsi, kernel-janitors
Dan,
> This patch is basically to silence a static checker warning.
>
> drivers/scsi/libfc/fc_disc.c:326 fc_disc_error()
> warn: passing a valid pointer to 'PTR_ERR'
>
> It doesn't affect runtime because it treats -ENOMEM and a valid pointer
> the same. But the documentation says we should be passing an error
> pointer.
Applied to 4.13/scsi-fixes. Thank you!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-12 21:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 7:30 [PATCH] scsi: libfc: pass an error pointer to fc_disc_error() Dan Carpenter
2017-07-12 7:54 ` Johannes Thumshirn
2017-07-12 21:25 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox