Commit ca065bf1 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

USB: apple-mfi-fastcharge: fix endianess issue in probe

The product ID is little endian and needs to be converted.
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarOliver Neukum <oneukum@suse.com>
Reviewed-by: default avatarBastien Nocera <hadess@hadess.net>
Link: https://lore.kernel.org/r/20200213111336.32392-1-oneukum@suse.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 249fa821
......@@ -167,11 +167,11 @@ static int mfi_fc_probe(struct usb_device *udev)
{
struct power_supply_config battery_cfg = {};
struct mfi_device *mfi = NULL;
int err;
int err, idProduct;
idProduct = le16_to_cpu(udev->descriptor.idProduct);
/* See comment above mfi_fc_id_table[] */
if (udev->descriptor.idProduct < 0x1200 ||
udev->descriptor.idProduct > 0x12ff) {
if (idProduct < 0x1200 || idProduct > 0x12ff) {
return -ENODEV;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment