Hi,
Static analysis with cppcheck has found an issue with a function that
returns an int value but there is a code path that does not return a
value causing undefined behaviour:
Source: drivers/net/wireless/realtek/rtlwifi/usb.c function
_rtl_rx_get_padding - introduced by commit:
commit 354d0f3c40fb40193213e40f3177ff528798ca8d
Author: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
Date: Wed Sep 25 12:57:47 2013 -0500
rtlwifi: Fix smatch warnings in usb.c
The issue occurs when NET_IP_ALIGN is zero and when len >= sizeof(*hdr),
then the following return is *not* taken:
/* make function no-op when possible */
if (NET_IP_ALIGN == 0 || len < sizeof(*hdr))
return 0
and then execution reaches the end of the function where no return value
is returned because the #if NET_IP_ALIGN != 0 is false so the return
padding hunk of the code is not compiled in.
Colin