diff mbox series

[net] net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings

Message ID 20240619132816.11526-1-oneukum@suse.com (mailing list archive)
State Accepted
Commit fba383985354e83474f95f36d7c65feb75dba19d
Delegated to: Netdev Maintainers
Headers show
Series [net] net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 859 this patch: 859
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 863 this patch: 863
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 864 this patch: 864
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-06-20--03-00 (tests: 659)

Commit Message

Oliver Neukum June 19, 2024, 1:28 p.m. UTC
This functions retrieves values by passing a pointer. As the function
that retrieves them can fail before touching the pointers, the variables
must be initialized.

Reported-by: syzbot+5186630949e3c55f0799@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/net/usb/rtl8150.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Petko Manolov June 19, 2024, 2:16 p.m. UTC | #1
On 24-06-19 15:28:03, Oliver Neukum wrote:
> This functions retrieves values by passing a pointer. As the function that
> retrieves them can fail before touching the pointers, the variables must be
> initialized.

ACK.


		Petko


> Reported-by: syzbot+5186630949e3c55f0799@syzkaller.appspotmail.com
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> ---
>  drivers/net/usb/rtl8150.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
> index 97afd7335d86..01a3b2417a54 100644
> --- a/drivers/net/usb/rtl8150.c
> +++ b/drivers/net/usb/rtl8150.c
> @@ -778,7 +778,8 @@ static int rtl8150_get_link_ksettings(struct net_device *netdev,
>  				      struct ethtool_link_ksettings *ecmd)
>  {
>  	rtl8150_t *dev = netdev_priv(netdev);
> -	short lpa, bmcr;
> +	short lpa = 0;
> +	short bmcr = 0;
>  	u32 supported;
>  
>  	supported = (SUPPORTED_10baseT_Half |
> -- 
> 2.45.1
> 
>
patchwork-bot+netdevbpf@kernel.org June 20, 2024, 2:20 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 19 Jun 2024 15:28:03 +0200 you wrote:
> This functions retrieves values by passing a pointer. As the function
> that retrieves them can fail before touching the pointers, the variables
> must be initialized.
> 
> Reported-by: syzbot+5186630949e3c55f0799@syzkaller.appspotmail.com
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> 
> [...]

Here is the summary with links:
  - [net] net: usb: rtl8150 fix unintiatilzed variables in rtl8150_get_link_ksettings
    https://git.kernel.org/netdev/net/c/fba383985354

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index 97afd7335d86..01a3b2417a54 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -778,7 +778,8 @@  static int rtl8150_get_link_ksettings(struct net_device *netdev,
 				      struct ethtool_link_ksettings *ecmd)
 {
 	rtl8150_t *dev = netdev_priv(netdev);
-	short lpa, bmcr;
+	short lpa = 0;
+	short bmcr = 0;
 	u32 supported;
 
 	supported = (SUPPORTED_10baseT_Half |