diff mbox series

scsi: elx: libefc: signedness bug in efc_d_send_prli_rsp()

Message ID YMyi4LNaVmD7kQEN@mwanda (mailing list archive)
State Superseded
Headers show
Series scsi: elx: libefc: signedness bug in efc_d_send_prli_rsp() | expand

Commit Message

Dan Carpenter June 18, 2021, 1:42 p.m. UTC
The "rc" variable needs to be signed for the error handling to work.
It holds either a negative error code, EFC_SCSI_CALL_COMPLETE (0),
or EFC_SCSI_CALL_ASYNC (1).

Fixes: 202bfdffae27 ("scsi: elx: libefc: FC node ELS and state handling")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/elx/libefc/efc_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Smart June 19, 2021, 3:44 p.m. UTC | #1
On 6/18/2021 6:42 AM, Dan Carpenter wrote:
> The "rc" variable needs to be signed for the error handling to work.
> It holds either a negative error code, EFC_SCSI_CALL_COMPLETE (0),
> or EFC_SCSI_CALL_ASYNC (1).
> 
> Fixes: 202bfdffae27 ("scsi: elx: libefc: FC node ELS and state handling")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/scsi/elx/libefc/efc_device.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks!

Reviewed-by: James Smart <jsmart2021@gmail.com>

-- james
diff mbox series

Patch

diff --git a/drivers/scsi/elx/libefc/efc_device.c b/drivers/scsi/elx/libefc/efc_device.c
index 31a688bce6e9..725ca2a23fb2 100644
--- a/drivers/scsi/elx/libefc/efc_device.c
+++ b/drivers/scsi/elx/libefc/efc_device.c
@@ -15,7 +15,7 @@ 
 void
 efc_d_send_prli_rsp(struct efc_node *node, u16 ox_id)
 {
-	u32 rc = EFC_SCSI_CALL_COMPLETE;
+	int rc = EFC_SCSI_CALL_COMPLETE;
 	struct efc *efc = node->efc;
 
 	node->ls_acc_oxid = ox_id;