Patch "qed (gcc13): use u16 for fid to be big enough" has been added to the 6.0-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

    qed (gcc13): use u16 for fid to be big enough

to the 6.0-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:
     qed-gcc13-use-u16-for-fid-to-be-big-enough.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 8157da162fcd683c8e41d69c0ee6f9ee6c2ed145
Author: Jiri Slaby (SUSE) <jirislaby@xxxxxxxxxx>
Date:   Mon Oct 31 12:43:54 2022 +0100

    qed (gcc13): use u16 for fid to be big enough
    
    [ Upstream commit 7d84118229bf7f7290438c85caa8e49de52d50c1 ]
    
    gcc 13 correctly reports overflow in qed_grc_dump_addr_range():
    In file included from drivers/net/ethernet/qlogic/qed/qed.h:23,
                     from drivers/net/ethernet/qlogic/qed/qed_debug.c:10:
    drivers/net/ethernet/qlogic/qed/qed_debug.c: In function 'qed_grc_dump_addr_range':
    include/linux/qed/qed_if.h:1217:9: error: overflow in conversion from 'int' to 'u8' {aka 'unsigned char'} changes value from '(int)vf_id << 8 | 128' to '128' [-Werror=overflow]
    
    We do:
      u8 fid;
      ...
      fid = vf_id << 8 | 128;
    
    Since fid is 16bit (and the stored value above too), fid should be u16,
    not u8. Fix that.
    
    Cc: Martin Liska <mliska@xxxxxxx>
    Cc: Ariel Elior <aelior@xxxxxxxxxxx>
    Cc: Manish Chopra <manishc@xxxxxxxxxxx>
    Signed-off-by: Jiri Slaby (SUSE) <jirislaby@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221031114354.10398-1-jirislaby@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/qlogic/qed/qed_debug.c b/drivers/net/ethernet/qlogic/qed/qed_debug.c
index 5250d1d1e49c..86ecb080b153 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_debug.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_debug.c
@@ -1972,9 +1972,10 @@ static u32 qed_grc_dump_addr_range(struct qed_hwfn *p_hwfn,
 				   u8 split_id)
 {
 	struct dbg_tools_data *dev_data = &p_hwfn->dbg_info;
-	u8 port_id = 0, pf_id = 0, vf_id = 0, fid = 0;
+	u8 port_id = 0, pf_id = 0, vf_id = 0;
 	bool read_using_dmae = false;
 	u32 thresh;
+	u16 fid;
 
 	if (!dump)
 		return len;



[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