Re: [PATCH] renesas; Silence uninitialized variable report inusbhsg_recip_run_handle()

From: Felipe Balbi
Date: Tue Jan 24 2012 - 03:11:32 EST


On Mon, Jan 16, 2012 at 10:42:10PM +0100, Jesper Juhl wrote:
> In drivers/usb/renesas_usbhs/mod_gadget.c::usbhsg_recip_run_handle()
> the Coverity Prevent checker currently flags a warning about possibly
> uninitialized use of 'ret' i usbhsg_recip_run_handle(). It does this
> since it assumes we take one of the non-default branches in the switch
> and then subsequently take the false branch in the 'if (func)' case
> below. This exact scenario will never happen, but Coverity can't see
> that for some reason. This patch initializes 'ret' to '0' when it is
> declared which should shut up this report and won't really hurt - so
> why not? At least then it's clear that 'ret' is always initialized..
>
> Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>

applied, thanks

--
balbi

Attachment: signature.asc
Description: Digital signature