lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Sep 2015 10:57:59 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Andrzej Pietrasiewicz <andrzej.p@...sung.com>
cc:	kbuild-all@...org, Felipe Balbi <balbi@...com>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: uvc: fix returnvar.cocci warnings

Coccinelle suggests the following patch.  But the code is curious.  Is the
function expected to always return a failure value?

thanks,
julia

On Thu, 17 Sep 2015, kbuild test robot wrote:

> TO: Andrzej Pietrasiewicz <andrzej.p@...sung.com>
> CC: kbuild-all@...org
> CC: Felipe Balbi <balbi@...com>
> CC: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> CC: "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>
> CC: linux-usb@...r.kernel.org
> CC: linux-kernel@...r.kernel.org
>
> drivers/usb/gadget/function/uvc_configfs.c:866:5-8: Unneeded variable: "ret". Return "- EINVAL" on line 891
>
>
>  Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> CC: Andrzej Pietrasiewicz <andrzej.p@...sung.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@...el.com>
> ---
>
> Please take the patch only if it's a positive warning. Thanks!
>
>  uvc_configfs.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -863,7 +863,6 @@ static int uvcg_streaming_header_drop_li
>  	struct uvcg_streaming_header *src_hdr;
>  	struct uvcg_format *target_fmt = NULL;
>  	struct uvcg_format_ptr *format_ptr, *tmp;
> -	int ret = -EINVAL;
>
>  	src_hdr = to_uvcg_streaming_header(src);
>  	mutex_lock(su_mutex); /* for navigating configfs hierarchy */
> @@ -888,7 +887,7 @@ static int uvcg_streaming_header_drop_li
>  out:
>  	mutex_unlock(&opts->lock);
>  	mutex_unlock(su_mutex);
> -	return ret;
> +	return -EINVAL;
>
>  }
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ