diff mbox series

[1/1] drivers/scsi: remove dead code

Message ID 20241213225852.62741-2-ariel.otilibili-anieli@eurecom.fr
State New
Headers show
Series drivers/scsi: remove dead code | expand

Commit Message

Ariel Otilibili Dec. 13, 2024, 10:57 p.m. UTC
* reported by Coverity ID 1602240
* ldev_info is always true, therefore the branch statement is never called.

Fixes: 081ff398c56cc ("scsi: myrb: Add Mylex RAID controller (block interface)")
Cc: Hannes Reinecke <hare@kernel.org>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@eurecom.fr>
---
 drivers/scsi/myrb.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Ariel Otilibili Dec. 18, 2024, 11:59 p.m. UTC | #1
Hello,

Is there any news of the patch? Your feedback is much appreciated.

Have a good day,
Ariel

On Friday, December 13, 2024 23:57 CET, Ariel Otilibili <ariel.otilibili-anieli@eurecom.fr> wrote:

> * reported by Coverity ID 1602240
> * ldev_info is always true, therefore the branch statement is never called.
> 
> Fixes: 081ff398c56cc ("scsi: myrb: Add Mylex RAID controller (block interface)")
> Cc: Hannes Reinecke <hare@kernel.org>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
> Signed-off-by: Ariel Otilibili <ariel.otilibili-anieli@eurecom.fr>
> ---
>  drivers/scsi/myrb.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
> index 363d71189cfe..dc4bd422b601 100644
> --- a/drivers/scsi/myrb.c
> +++ b/drivers/scsi/myrb.c
> @@ -1627,8 +1627,6 @@ static int myrb_ldev_sdev_init(struct scsi_device *sdev)
>  	enum raid_level level;
>  
>  	ldev_info = cb->ldev_info_buf + ldev_num;
> -	if (!ldev_info)
> -		return -ENXIO;
>  
>  	sdev->hostdata = kzalloc(sizeof(*ldev_info), GFP_KERNEL);
>  	if (!sdev->hostdata)
> -- 
> 2.47.1
>
diff mbox series

Patch

diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index 363d71189cfe..dc4bd422b601 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -1627,8 +1627,6 @@  static int myrb_ldev_sdev_init(struct scsi_device *sdev)
 	enum raid_level level;
 
 	ldev_info = cb->ldev_info_buf + ldev_num;
-	if (!ldev_info)
-		return -ENXIO;
 
 	sdev->hostdata = kzalloc(sizeof(*ldev_info), GFP_KERNEL);
 	if (!sdev->hostdata)