Commit b01ddcb
committed
usb: phytium_v2: fix uninitialized ret in gadget_start
Log:
2025-05-16T12:01:20.8409093Z drivers/usb/phytium_usb_v2/gadget.c:1563:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
2025-05-16T12:01:20.8411014Z 1563 | if (!pdev->setup_buf)
2025-05-16T12:01:20.8411857Z | ^~~~~~~~~~~~~~~~
2025-05-16T12:01:20.8412989Z drivers/usb/phytium_usb_v2/gadget.c:1600:9: note: uninitialized use occurs here
2025-05-16T12:01:20.8414076Z 1600 | return ret;
2025-05-16T12:01:20.8414775Z | ^~~
2025-05-16T12:01:20.8415931Z drivers/usb/phytium_usb_v2/gadget.c:1563:2: note: remove the 'if' if its condition is always false
2025-05-16T12:01:20.8417705Z 1563 | if (!pdev->setup_buf)
2025-05-16T12:01:20.8418583Z | ^~~~~~~~~~~~~~~~~~~~~
2025-05-16T12:01:20.8419358Z 1564 | goto free_pdev;
2025-05-16T12:01:20.8420170Z | ~~~~~~~~~~~~~~
2025-05-16T12:01:20.8421430Z drivers/usb/phytium_usb_v2/gadget.c:1525:9: note: initialize the variable 'ret' to silence this warning
2025-05-16T12:01:20.8422666Z 1525 | int ret;
2025-05-16T12:01:20.8423346Z | ^
2025-05-16T12:01:20.8424036Z | = 0
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent 7f1452f commit b01ddcb
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1522 | 1522 | | |
1523 | 1523 | | |
1524 | 1524 | | |
1525 | | - | |
| 1525 | + | |
1526 | 1526 | | |
1527 | 1527 | | |
1528 | 1528 | | |
| |||
0 commit comments