Re: [patch 2/2] be2iscsi: null dereference on error path

Mike Christie
2010-06-10T20:43:17Z

On 06/10/2010 02:53 AM, Dan Carpenter wrote:
> "phba" is always null here so we can't dereference it.
>
> Signed-off-by: Dan Carpenter<error27@gmail.com>
>
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index 779e1d1..efadde9 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -3774,8 +3774,8 @@ static int __devinit beiscsi_dev_probe(struct pci_dev *pcidev,
>
> ret = beiscsi_enable_pci(pcidev);
> if (ret< 0) {
> - shost_printk(KERN_ERR, phba->shost, "beiscsi_dev_probe-"
> - "Failed to enable pci device \n");
> + dev_err(&pcidev->dev, "beiscsi_dev_probe-"
> + " Failed to enable pci device\n");
> return ret;
> }
>

Looks good. Thanks.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>