Patch "media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address" has been added to the 5.10-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

    media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address

to the 5.10-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:
     media-dvb-usb-dw2102-fix-uninit-value-in-su3000_read.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 90414eb7c1ffa3da1d77b70474c47ead34c4ea4e
Author: Wei Chen <harperchen1110@xxxxxxxxx>
Date:   Tue Mar 28 13:44:16 2023 +0100

    media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address
    
    [ Upstream commit a3fd1ef27aa686d871cefe207bd6168c4b0cd29e ]
    
    In su3000_read_mac_address, if i2c_transfer fails to execute two
    messages, array mac address will not be initialized. Without handling
    such error, later in function dvb_usb_adapter_dvb_init, proposed_mac
    is accessed before initialization.
    
    Fix this error by returning a negative value if message execution fails.
    
    Link: https://lore.kernel.org/linux-media/20230328124416.560889-1-harperchen1110@xxxxxxxxx
    Signed-off-by: Wei Chen <harperchen1110@xxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
index aa929db56db1f..3c4ac998d040f 100644
--- a/drivers/media/usb/dvb-usb/dw2102.c
+++ b/drivers/media/usb/dvb-usb/dw2102.c
@@ -946,7 +946,7 @@ static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
 	for (i = 0; i < 6; i++) {
 		obuf[1] = 0xf0 + i;
 		if (i2c_transfer(&d->i2c_adap, msg, 2) != 2)
-			break;
+			return -1;
 		else
 			mac[i] = ibuf[0];
 	}



[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