linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Wei Yongjun <weiyongjun1@huawei.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-fsdevel@vger.kernel.org, devel@driverdev.osuosl.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] staging: Fix error return code in vboxsf_fill_super()
Date: Wed, 6 Nov 2019 13:03:44 +0100	[thread overview]
Message-ID: <e466fadc-0e0d-129a-5cf3-6be2c86873a0@redhat.com> (raw)
In-Reply-To: <20191106115954.114678-1-weiyongjun1@huawei.com>

Hi,

On 06-11-2019 12:59, Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: df4028658f9d ("staging: Add VirtualBox guest shared folder (vboxsf) support")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Good catch, thank you:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   drivers/staging/vboxsf/super.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vboxsf/super.c b/drivers/staging/vboxsf/super.c
> index 3913ffafa83b..0bf4d724aefd 100644
> --- a/drivers/staging/vboxsf/super.c
> +++ b/drivers/staging/vboxsf/super.c
> @@ -176,8 +176,10 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
>   	/* Turn source into a shfl_string and map the folder */
>   	size = strlen(fc->source) + 1;
>   	folder_name = kmalloc(SHFLSTRING_HEADER_SIZE + size, GFP_KERNEL);
> -	if (!folder_name)
> +	if (!folder_name) {
> +		err = -ENOMEM;
>   		goto fail_free;
> +	}
>   	folder_name->size = size;
>   	folder_name->length = size - 1;
>   	strlcpy(folder_name->string.utf8, fc->source, size);
> 
> 
> 


      reply	other threads:[~2019-11-06 12:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 11:59 [PATCH -next] staging: Fix error return code in vboxsf_fill_super() Wei Yongjun
2019-11-06 12:03 ` Hans de Goede [this message]

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=e466fadc-0e0d-129a-5cf3-6be2c86873a0@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).