Patch "niu: Fix missing unwind goto in niu_alloc_channels()" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    niu: Fix missing unwind goto in niu_alloc_channels()

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     niu-fix-missing-unwind-goto-in-niu_alloc_channels.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c925c03983002d18a77a7e81c943cca158c83ac6
Author: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
Date:   Wed Apr 5 23:31:18 2023 -0700

    niu: Fix missing unwind goto in niu_alloc_channels()
    
    [ Upstream commit 8ce07be703456acb00e83d99f3b8036252c33b02 ]
    
    Smatch reports: drivers/net/ethernet/sun/niu.c:4525
            niu_alloc_channels() warn: missing unwind goto?
    
    If niu_rbr_fill() fails, then we are directly returning 'err' without
    freeing the channels.
    
    Fix this by changing direct return to a goto 'out_err'.
    
    Fixes: a3138df9f20e ("[NIU]: Add Sun Neptune ethernet driver.")
    Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@xxxxxxxxxx>
    Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 7ba9cad183414..08ac19884133b 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -4520,7 +4520,7 @@ static int niu_alloc_channels(struct niu *np)
 
 		err = niu_rbr_fill(np, rp, GFP_KERNEL);
 		if (err)
-			return err;
+			goto out_err;
 	}
 
 	tx_rings = kcalloc(num_tx_rings, sizeof(struct tx_ring_info),



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux