Skip to content

Commit 1edf489

Browse files
pawellcdnsgregkh
authored andcommitted
usb: cdnsp: Fixes error: uninitialized symbol 'len'
The patch 5bc38d3: "usb: cdnsp: Fixes issue with redundant Status Stage" leads to the following Smatch static checker warning: drivers/usb/cdns3/cdnsp-ep0.c:470 cdnsp_setup_analyze() error: uninitialized symbol 'len'. cc: <[email protected]> Fixes: 5bc38d3 ("usb: cdnsp: Fixes issue with redundant Status Stage") Signed-off-by: Pawel Laszczak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent e07fec4 commit 1edf489

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/usb/cdns3/cdnsp-ep0.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static int cdnsp_ep0_std_request(struct cdnsp_device *pdev,
414414
void cdnsp_setup_analyze(struct cdnsp_device *pdev)
415415
{
416416
struct usb_ctrlrequest *ctrl = &pdev->setup;
417-
int ret = 0;
417+
int ret = -EINVAL;
418418
u16 len;
419419

420420
trace_cdnsp_ctrl_req(ctrl);
@@ -424,7 +424,6 @@ void cdnsp_setup_analyze(struct cdnsp_device *pdev)
424424

425425
if (pdev->gadget.state == USB_STATE_NOTATTACHED) {
426426
dev_err(pdev->dev, "ERR: Setup detected in unattached state\n");
427-
ret = -EINVAL;
428427
goto out;
429428
}
430429

0 commit comments

Comments
 (0)