mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
wifi: ath9k_htc: don't store usb_device_id
usb_device_id is not guaranteed to live longer than probe due to presence of dynamic ID. All information apart from driver_data can be easily retrieved from usb_device, so just store driver_data. Signed-off-by: Gary Guo <gary@garyguo.net> Link: https://patch.msgid.link/20260707-usb_dyn_id_uaf-v2-1-632dcf3adfba@garyguo.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
713de18af5
commit
14d2ac442d
@@ -1087,7 +1087,7 @@ static int ath9k_hif_usb_download_fw(struct hif_device_usb *hif_dev)
|
||||
}
|
||||
kfree(buf);
|
||||
|
||||
if (IS_AR7010_DEVICE(hif_dev->usb_device_id->driver_info))
|
||||
if (IS_AR7010_DEVICE(hif_dev->id_info))
|
||||
firm_offset = AR7010_FIRMWARE_TEXT;
|
||||
else
|
||||
firm_offset = AR9271_FIRMWARE_TEXT;
|
||||
@@ -1182,7 +1182,7 @@ static int ath9k_hif_request_firmware(struct hif_device_usb *hif_dev,
|
||||
if (MAJOR_VERSION_REQ == 1 && hif_dev->fw_minor_index == 3) {
|
||||
const char *filename;
|
||||
|
||||
if (IS_AR7010_DEVICE(hif_dev->usb_device_id->driver_info))
|
||||
if (IS_AR7010_DEVICE(hif_dev->id_info))
|
||||
filename = FIRMWARE_AR7010_1_1;
|
||||
else
|
||||
filename = FIRMWARE_AR9271;
|
||||
@@ -1198,7 +1198,7 @@ static int ath9k_hif_request_firmware(struct hif_device_usb *hif_dev,
|
||||
|
||||
return -ENOENT;
|
||||
} else {
|
||||
if (IS_AR7010_DEVICE(hif_dev->usb_device_id->driver_info))
|
||||
if (IS_AR7010_DEVICE(hif_dev->id_info))
|
||||
chip = "7010";
|
||||
else
|
||||
chip = "9271";
|
||||
@@ -1260,9 +1260,9 @@ static void ath9k_hif_usb_firmware_cb(const struct firmware *fw, void *context)
|
||||
|
||||
ret = ath9k_htc_hw_init(hif_dev->htc_handle,
|
||||
&hif_dev->interface->dev,
|
||||
hif_dev->usb_device_id->idProduct,
|
||||
le16_to_cpu(hif_dev->udev->descriptor.idProduct),
|
||||
hif_dev->udev->product,
|
||||
hif_dev->usb_device_id->driver_info);
|
||||
hif_dev->id_info);
|
||||
if (ret) {
|
||||
ret = -EINVAL;
|
||||
goto err_htc_hw_init;
|
||||
@@ -1374,7 +1374,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
|
||||
|
||||
hif_dev->udev = udev;
|
||||
hif_dev->interface = interface;
|
||||
hif_dev->usb_device_id = id;
|
||||
hif_dev->id_info = id->driver_info;
|
||||
#ifdef CONFIG_PM
|
||||
udev->reset_resume = 1;
|
||||
#endif
|
||||
|
||||
@@ -115,7 +115,7 @@ struct cmd_buf {
|
||||
struct hif_device_usb {
|
||||
struct usb_device *udev;
|
||||
struct usb_interface *interface;
|
||||
const struct usb_device_id *usb_device_id;
|
||||
int id_info;
|
||||
const void *fw_data;
|
||||
size_t fw_size;
|
||||
struct completion fw_done;
|
||||
|
||||
Reference in New Issue
Block a user