lkml.org 
[lkml]   [2012]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] usb: gadget: mass_storage: require backing file for non-removable LUNs
Hello.

On 18-06-2012 16:37, Michal Nazarewicz wrote:

> From: Michal Nazarewicz<mina86@mina86.com>

> The fsg_file_store()

Apparently, fsg_store_file(), judging by the patch itself.

> function does not check whether a LUN is removable or not
> allowing one to specify an empty file name for a non-removable LUN. This
> commit adds explicit check of whether a file name is provided for
> non-removable LUNs.

> Signed-off-by: Michal Nazarewicz<mina86@mina86.com>
> ---
> drivers/usb/gadget/storage_common.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)

> diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c
> index e576678..52334d7 100644
> --- a/drivers/usb/gadget/storage_common.c
> +++ b/drivers/usb/gadget/storage_common.c
> @@ -878,6 +878,9 @@ static ssize_t fsg_store_file(struct device *dev, struct device_attribute *attr,
> if (count > 0 && buf[count-1] == '\n')
> ((char *) buf)[count-1] = 0; /* Ugh! */
>
> + /* Must specify a valid file if LUN is not removable. */
> + if (!curlun->removable&& !*buf)
> + return -EINVAL;

WBR, Sergei


\
 
 \ /
  Last update: 2012-06-19 13:41    [W:0.063 / U:1.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site