public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <mchristi@redhat.com>
To: Wei Yongjun <weiyongjun1@huawei.com>,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] tcmu: fix error return code in tcmu_configure_device()
Date: Thu, 11 Jan 2018 17:10:52 +0000	[thread overview]
Message-ID: <5A579A9C.3090004@redhat.com> (raw)
In-Reply-To: <1515669145-125352-1-git-send-email-weiyongjun1@huawei.com>

On 01/11/2018 05:12 AM, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the kzalloc() error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: fabe6a59cc5a ("tcmu: allow max block and global max blocks to be settable")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/target/target_core_user.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c
> index bac08bc..2edd242 100644
> --- a/drivers/target/target_core_user.c
> +++ b/drivers/target/target_core_user.c
> @@ -1705,8 +1705,10 @@ static int tcmu_configure_device(struct se_device *dev)
>  
>  	udev->data_bitmap = kzalloc(BITS_TO_LONGS(udev->max_blocks) *
>  				    sizeof(unsigned long), GFP_KERNEL);
> -	if (!udev->data_bitmap)
> +	if (!udev->data_bitmap) {
> +		ret = -ENOMEM;
>  		goto err_bitmap_alloc;
> +	}
>  
>  	udev->mb_addr = vzalloc(CMDR_SIZE);
>  	if (!udev->mb_addr) {
> 

Thanks.

Acked-by: Mike Christie <mchristi@redhat.com>

  reply	other threads:[~2018-01-11 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11 11:12 [PATCH -next] tcmu: fix error return code in tcmu_configure_device() Wei Yongjun
2018-01-11 17:10 ` Mike Christie [this message]
2018-01-13  5:19   ` Nicholas A. Bellinger

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=5A579A9C.3090004@redhat.com \
    --to=mchristi@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@vger.kernel.org \
    --cc=weiyongjun1@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox