Skip to content

Commit

Permalink
scsi: qedi: Remove redundant assignment to variable err
Browse files Browse the repository at this point in the history
Variable err is assigned -ENOMEM followed by an error return path via label
err_udev that does not access the variable and returns with the -ENOMEM
error return code. The assignment to err is redundant and can be removed.

Link: https://lore.kernel.org/r/20210327230650.25803-1-colin.king@canonical.com
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Colin Ian King authored and Martin K. Petersen committed Mar 30, 2021
1 parent fe515ac commit 8dc6025
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/scsi/qedi/qedi_main.c
Original file line number Diff line number Diff line change
@@ -276,10 +276,8 @@ static int qedi_alloc_uio_rings(struct qedi_ctx *qedi)
}

udev = kzalloc(sizeof(*udev), GFP_KERNEL);
if (!udev) {
rc = -ENOMEM;
if (!udev)
goto err_udev;
}

udev->uio_dev = -1;

0 comments on commit 8dc6025

Please sign in to comment.