media: atomisp: add a notice about possible leak resources

Calling acpi_bus_get_device() may end allocating resources that
aren't freed. So, add a notice about that, as, if those drivers
get out of staging, we may need some changes.

Fixes: 0d64e94205 ("media: atomisp: Add some ACPI detection info")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab 2020-05-12 14:23:28 +02:00
parent 814634b8e8
commit c03496b3bd
7 changed files with 8 additions and 7 deletions

View file

@ -1317,9 +1317,10 @@ static int gc0310_probe(struct i2c_client *client)
dev_err(&client->dev, "Error could not get ACPI device\n"); dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV; return -ENODEV;
} }
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev)); __func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)

View file

@ -1059,9 +1059,9 @@ static int gc2235_probe(struct i2c_client *client)
dev_err(&client->dev, "Error could not get ACPI device\n"); dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV; return -ENODEV;
} }
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev)); __func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)

View file

@ -858,9 +858,9 @@ static int lm3554_probe(struct i2c_client *client)
dev_err(&client->dev, "Error could not get ACPI device\n"); dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV; return -ENODEV;
} }
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev)); __func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
flash = kzalloc(sizeof(*flash), GFP_KERNEL); flash = kzalloc(sizeof(*flash), GFP_KERNEL);
if (!flash) if (!flash)

View file

@ -1824,9 +1824,9 @@ static int mt9m114_probe(struct i2c_client *client)
dev_err(&client->dev, "Error could not get ACPI device\n"); dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV; return -ENODEV;
} }
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev)); __func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
/* Setup sensor configuration structure */ /* Setup sensor configuration structure */
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);

View file

@ -1251,9 +1251,9 @@ static int ov2680_probe(struct i2c_client *client)
dev_err(&client->dev, "Error could not get ACPI device\n"); dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV; return -ENODEV;
} }
dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n", dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev)); __func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)

View file

@ -1222,9 +1222,9 @@ static int ov2722_probe(struct i2c_client *client)
dev_err(&client->dev, "Error could not get ACPI device\n"); dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV; return -ENODEV;
} }
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev)); __func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)

View file

@ -1909,9 +1909,9 @@ static int ov5693_probe(struct i2c_client *client)
dev_err(&client->dev, "Error could not get ACPI device\n"); dev_err(&client->dev, "Error could not get ACPI device\n");
return -ENODEV; return -ENODEV;
} }
pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n",
__func__, acpi_device_bid(adev), acpi_device_hid(adev)); __func__, acpi_device_bid(adev), acpi_device_hid(adev));
// FIXME: may need to release resources allocated by acpi_bus_get_device()
/* /*
* Firmware workaround: Some modules use a "secondary default" * Firmware workaround: Some modules use a "secondary default"