Patch "HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc" has been added to the 5.15-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

    HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc

to the 5.15-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:
     hid-intel-ish-hid-ipc-fix-dev_err-usage-with-uniniti.patch
and it can be found in the queue-5.15 subdirectory.

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



commit f84556d6dae8f7f010b6bf0b66870f270ba5e843
Author: Zhang Lixu <lixu.zhang@xxxxxxxxx>
Date:   Wed Mar 6 00:44:04 2024 +0000

    HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc
    
    [ Upstream commit 92826905ae340b7f2b25759a06c8c60bfc476b9f ]
    
    The variable dev->devc in ish_dev_init was utilized by dev_err before it
    was properly assigned. To rectify this, the assignment of dev->devc has
    been moved to immediately follow memory allocation.
    
    Without this change "(NULL device *)" is printed for device information.
    
    Fixes: 8ae2f2b0a284 ("HID: intel-ish-hid: ipc: Fix potential use-after-free in work function")
    Fixes: ae02e5d40d5f ("HID: intel-ish-hid: ipc layer")
    Signed-off-by: Zhang Lixu <lixu.zhang@xxxxxxxxx>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxxxxxx>
    Signed-off-by: Jiri Kosina <jkosina@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hid/intel-ish-hid/ipc/ipc.c b/drivers/hid/intel-ish-hid/ipc/ipc.c
index 6c942dd1abca2..ba45605fc6b52 100644
--- a/drivers/hid/intel-ish-hid/ipc/ipc.c
+++ b/drivers/hid/intel-ish-hid/ipc/ipc.c
@@ -944,6 +944,7 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev)
 	if (!dev)
 		return NULL;
 
+	dev->devc = &pdev->dev;
 	ishtp_device_init(dev);
 
 	init_waitqueue_head(&dev->wait_hw_ready);
@@ -979,7 +980,6 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev)
 	}
 
 	dev->ops = &ish_hw_ops;
-	dev->devc = &pdev->dev;
 	dev->mtu = IPC_PAYLOAD_SIZE - sizeof(struct ishtp_msg_hdr);
 	return dev;
 }




[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