All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	jayamohan.kallickal@avagotech.com, jejb@linux.vnet.ibm.com,
	ketan.mukadam@avagotech.com, sony.john@avagotech.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: RE: [PATCH 1/2] be2iscsi: Fix error return code
Date: Tue, 16 Aug 2016 06:16:28 +0000	[thread overview]
Message-ID: <a9ab4e196fb105b4df1abb6dc344962d@mail.gmail.com> (raw)
In-Reply-To: <1470996152-31081-1-git-send-email-christophe.jaillet@wanadoo.fr>

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Christophe JAILLET
> Sent: Friday, August 12, 2016 3:33 PM
> To: jayamohan.kallickal@avagotech.com; jejb@linux.vnet.ibm.com;
> ketan.mukadam@avagotech.com; sony.john@avagotech.com;
> martin.petersen@oracle.com
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; kernel-
> janitors@vger.kernel.org; Christophe JAILLET
> Subject: [PATCH 1/2] be2iscsi: Fix error return code
>
> We know that 'ret' is not an error code because it has been tested a few
> lines
> above.
> So, if one of these function fails, 0 will be returned instead of an error
> code.
> Return -ENOMEM instead.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/scsi/be2iscsi/be_main.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/be2iscsi/be_main.c
> b/drivers/scsi/be2iscsi/be_main.c
> index f05e7737107d..89ae6390b697 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -3286,8 +3286,10 @@ static int beiscsi_create_eqs(struct beiscsi_hba
> *phba,
>  		eq_vaddress = pci_alloc_consistent(phba->pcidev,
>  						     num_eq_pages *
> PAGE_SIZE,
>  						     &paddr);
> -		if (!eq_vaddress)
> +		if (!eq_vaddress) {
> +			ret = -ENOMEM;
>  			goto create_eq_error;
> +		}
>
>  		mem->va = eq_vaddress;
>  		ret = be_fill_queue(eq, phba->params.num_eq_entries, @@ -
> 3349,8 +3351,11 @@ static int beiscsi_create_cqs(struct beiscsi_hba *phba,
>  		cq_vaddress = pci_alloc_consistent(phba->pcidev,
>  						     num_cq_pages *
> PAGE_SIZE,
>  						     &paddr);
> -		if (!cq_vaddress)
> +		if (!cq_vaddress) {
> +			ret = -ENOMEM;
>  			goto create_cq_error;
> +		}
> +
>  		ret = be_fill_queue(cq, phba->params.num_cq_entries,
>  				    sizeof(struct sol_cqe), cq_vaddress);
>  		if (ret) {
> @@ -5635,6 +5640,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
>  	if (!phba) {
>  		dev_err(&pcidev->dev,
>  			"beiscsi_dev_probe - Failed in beiscsi_hba_alloc\n");
> +		ret = -ENOMEM;
>  		goto disable_pci;
>  	}
>
> @@ -5754,6 +5760,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
>  		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
>  			    "BM_%d : beiscsi_dev_probe-"
>  			    "Failed to allocate work queue\n");
> +		ret = -ENOMEM;
>  		goto free_twq;
>  	}
>

[JB] This still has to be fixed, right?

WARNING: multiple messages have this Message-ID (diff)
From: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	jayamohan.kallickal@avagotech.com, jejb@linux.vnet.ibm.com,
	ketan.mukadam@avagotech.com, sony.john@avagotech.com,
	martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: RE: [PATCH 1/2] be2iscsi: Fix error return code
Date: Tue, 16 Aug 2016 11:34:28 +0530	[thread overview]
Message-ID: <a9ab4e196fb105b4df1abb6dc344962d@mail.gmail.com> (raw)
In-Reply-To: <1470996152-31081-1-git-send-email-christophe.jaillet@wanadoo.fr>

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Christophe JAILLET
> Sent: Friday, August 12, 2016 3:33 PM
> To: jayamohan.kallickal@avagotech.com; jejb@linux.vnet.ibm.com;
> ketan.mukadam@avagotech.com; sony.john@avagotech.com;
> martin.petersen@oracle.com
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; kernel-
> janitors@vger.kernel.org; Christophe JAILLET
> Subject: [PATCH 1/2] be2iscsi: Fix error return code
>
> We know that 'ret' is not an error code because it has been tested a few
> lines
> above.
> So, if one of these function fails, 0 will be returned instead of an error
> code.
> Return -ENOMEM instead.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/scsi/be2iscsi/be_main.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/be2iscsi/be_main.c
> b/drivers/scsi/be2iscsi/be_main.c
> index f05e7737107d..89ae6390b697 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -3286,8 +3286,10 @@ static int beiscsi_create_eqs(struct beiscsi_hba
> *phba,
>  		eq_vaddress = pci_alloc_consistent(phba->pcidev,
>  						     num_eq_pages *
> PAGE_SIZE,
>  						     &paddr);
> -		if (!eq_vaddress)
> +		if (!eq_vaddress) {
> +			ret = -ENOMEM;
>  			goto create_eq_error;
> +		}
>
>  		mem->va = eq_vaddress;
>  		ret = be_fill_queue(eq, phba->params.num_eq_entries, @@ -
> 3349,8 +3351,11 @@ static int beiscsi_create_cqs(struct beiscsi_hba *phba,
>  		cq_vaddress = pci_alloc_consistent(phba->pcidev,
>  						     num_cq_pages *
> PAGE_SIZE,
>  						     &paddr);
> -		if (!cq_vaddress)
> +		if (!cq_vaddress) {
> +			ret = -ENOMEM;
>  			goto create_cq_error;
> +		}
> +
>  		ret = be_fill_queue(cq, phba->params.num_cq_entries,
>  				    sizeof(struct sol_cqe), cq_vaddress);
>  		if (ret) {
> @@ -5635,6 +5640,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
>  	if (!phba) {
>  		dev_err(&pcidev->dev,
>  			"beiscsi_dev_probe - Failed in beiscsi_hba_alloc\n");
> +		ret = -ENOMEM;
>  		goto disable_pci;
>  	}
>
> @@ -5754,6 +5760,7 @@ static int beiscsi_dev_probe(struct pci_dev *pcidev,
>  		beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT,
>  			    "BM_%d : beiscsi_dev_probe-"
>  			    "Failed to allocate work queue\n");
> +		ret = -ENOMEM;
>  		goto free_twq;
>  	}
>

[JB] This still has to be fixed, right?

  reply	other threads:[~2016-08-16  6:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-12 10:02 [PATCH 1/2] be2iscsi: Fix error return code Christophe JAILLET
2016-08-12 10:02 ` Christophe JAILLET
2016-08-16  6:04 ` Jitendra Bhivare [this message]
2016-08-16  6:16   ` Jitendra Bhivare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a9ab4e196fb105b4df1abb6dc344962d@mail.gmail.com \
    --to=jitendra.bhivare@broadcom.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=jayamohan.kallickal@avagotech.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=ketan.mukadam@avagotech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sony.john@avagotech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.