diff mbox

scsi: aic94xx: set an error code on failure

Message ID 20150818092029.GD3965@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Aug. 18, 2015, 9:20 a.m. UTC
We recently did some cleanup here and now the static checkers notice
that there is a missing error code when ioremap() fails.  Let's set it
to -ENOMEM.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Johannes Thumshirn Aug. 18, 2015, 9:58 a.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> writes:

> We recently did some cleanup here and now the static checkers notice
> that there is a missing error code when ioremap() fails.  Let's set it
> to -ENOMEM.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
> index 140cb8e..f6c336b 100644
> --- a/drivers/scsi/aic94xx/aic94xx_init.c
> +++ b/drivers/scsi/aic94xx/aic94xx_init.c
> @@ -104,6 +104,7 @@ static int asd_map_memio(struct asd_ha_struct *asd_ha)
>  		if (!io_handle->addr) {
>  			asd_printk("couldn't map MBAR%d of %s\n", i==0?0:1,
>  				   pci_name(asd_ha->pcidev));
> +			err = -ENOMEM;
>  			goto Err_unreq;
>  		}
>  	}
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff mbox

Patch

diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 140cb8e..f6c336b 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -104,6 +104,7 @@  static int asd_map_memio(struct asd_ha_struct *asd_ha)
 		if (!io_handle->addr) {
 			asd_printk("couldn't map MBAR%d of %s\n", i==0?0:1,
 				   pci_name(asd_ha->pcidev));
+			err = -ENOMEM;
 			goto Err_unreq;
 		}
 	}