linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>,
	<usb-storage@lists.one-eyed-alien.net>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] usb: sierra: fix a missing check of device_create_file
Date: Mon, 25 Mar 2019 10:15:15 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1903251013140.1485-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <20190325030828.14068-1-kjlu@umn.edu>

On Sun, 24 Mar 2019, Kangjie Lu wrote:

> device_create_file() could fail and return an error code. The fix
> captures the error and returns the error code upstream in case it
> indeed failed.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>  drivers/usb/storage/sierra_ms.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/storage/sierra_ms.c b/drivers/usb/storage/sierra_ms.c
> index 6ac60abd2e15..e605cbc3d8bf 100644
> --- a/drivers/usb/storage/sierra_ms.c
> +++ b/drivers/usb/storage/sierra_ms.c
> @@ -194,8 +194,6 @@ int sierra_ms_init(struct us_data *us)
>  		kfree(swocInfo);
>  	}
>  complete:
> -	result = device_create_file(&us->pusb_intf->dev, &dev_attr_truinst);
> -
> -	return 0;
> +	return device_create_file(&us->pusb_intf->dev, &dev_attr_truinst);
>  }

Acked-by: Alan Stern <stern@rowland.harvard.edu>

It's possible the original author intended the function to succeed even 
if device_create_file() failed, since the information in the file 
doesn't seem to be very important.  However, I will accept the patch.

Alan Stern


  reply	other threads:[~2019-03-25 14:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-24 22:39 [PATCH] usb: sierra: fix a missing check of device_create_file Kangjie Lu
2019-03-25  2:47 ` kbuild test robot
2019-03-25  3:08 ` [PATCH v2] " Kangjie Lu
2019-03-25 14:15   ` Alan Stern [this message]
2019-03-26  8:18 ` [PATCH] " Dan Carpenter
2019-03-26  8:23   ` [kbuild] " Dan Carpenter

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=Pine.LNX.4.44L0.1903251013140.1485-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=gregkh@linuxfoundation.org \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=usb-storage@lists.one-eyed-alien.net \
    /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).