diff mbox series

ethernet: e1000e: Fix possible uninit bug

Message ID 20230710005736.3273464-1-yhao016@ucr.edu (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series ethernet: e1000e: Fix possible uninit bug | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1341 this patch: 1341
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 1364 this patch: 1364
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: 1364 this patch: 1364
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yu Hao July 10, 2023, 12:57 a.m. UTC
The variable phy_data should be initialized in function e1e_rphy.
However, there is not return value check, which means there is a
possible uninit read later for the variable.

Signed-off-by: Yu Hao <yhao016@ucr.edu>
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pavan Chebbi July 10, 2023, 4:02 a.m. UTC | #1
On Mon, Jul 10, 2023 at 6:27 AM Yu Hao <yhao016@ucr.edu> wrote:
>
> The variable phy_data should be initialized in function e1e_rphy.
> However, there is not return value check, which means there is a
> possible uninit read later for the variable.
>
> Signed-off-by: Yu Hao <yhao016@ucr.edu>
> ---

Shouldn't this be a v2? You are addressing a comment on your original
patch right?
Also please specify the target tree name. This may need a fixes tag also.


>  drivers/net/ethernet/intel/e1000e/netdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index 771a3c909c45..a807358a8174 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -6909,7 +6909,7 @@ static int __e1000_resume(struct pci_dev *pdev)
>
>         /* report the system wakeup cause from S3/S4 */
>         if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) {
> -               u16 phy_data;
> +               u16 phy_data = 0;
>
>                 e1e_rphy(&adapter->hw, BM_WUS, &phy_data);
>                 if (phy_data) {
> --
> 2.34.1
>
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 771a3c909c45..a807358a8174 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6909,7 +6909,7 @@  static int __e1000_resume(struct pci_dev *pdev)
 
 	/* report the system wakeup cause from S3/S4 */
 	if (adapter->flags2 & FLAG2_HAS_PHY_WAKEUP) {
-		u16 phy_data;
+		u16 phy_data = 0;
 
 		e1e_rphy(&adapter->hw, BM_WUS, &phy_data);
 		if (phy_data) {