diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-12 14:23:28 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-20 15:02:34 +0200 |
commit | c03496b3bd9281524d11462dc24a7b660ec176c6 (patch) | |
tree | 4b9858a396f7a52c086bd6b12b4c66ab02e949f2 /drivers/staging | |
parent | 814634b8e81ff54bfed69bba14656fc703221bd0 (diff) |
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: 0d64e9420583 ("media: atomisp: Add some ACPI detection info")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging')
7 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c index b69a5b50e3bc..ad1bd7d6a02b 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c @@ -1317,9 +1317,10 @@ static int gc0310_probe(struct i2c_client *client) dev_err(&client->dev, "Error could not get ACPI device\n"); return -ENODEV; } - pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", __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); if (!dev) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c index e863e19f2669..a12dd0e858bc 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c @@ -1059,9 +1059,9 @@ static int gc2235_probe(struct i2c_client *client) dev_err(&client->dev, "Error could not get ACPI device\n"); return -ENODEV; } - pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", __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); if (!dev) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c index 0e9f80239dcb..a899145265ff 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c @@ -858,9 +858,9 @@ static int lm3554_probe(struct i2c_client *client) dev_err(&client->dev, "Error could not get ACPI device\n"); return -ENODEV; } - pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", __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); if (!flash) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c index e7af4bbd844b..ac61b391e3f9 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c @@ -1824,9 +1824,9 @@ static int mt9m114_probe(struct i2c_client *client) dev_err(&client->dev, "Error could not get ACPI device\n"); return -ENODEV; } - pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", __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 */ dev = kzalloc(sizeof(*dev), GFP_KERNEL); diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c index 334f23f35d4a..1b60f6a9c0e0 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c @@ -1251,9 +1251,9 @@ static int ov2680_probe(struct i2c_client *client) dev_err(&client->dev, "Error could not get ACPI device\n"); return -ENODEV; } - dev_info(&client->dev, "%s: ACPI detected it on bus ID=%s, HID=%s\n", __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); if (!dev) diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c index 08799054704a..718d10f89d5a 100644 --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c @@ -1222,9 +1222,9 @@ static int ov2722_probe(struct i2c_client *client) dev_err(&client->dev, "Error could not get ACPI device\n"); return -ENODEV; } - pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", __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); if (!dev) diff --git a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c index 886f9fd0152f..2be0ef14d53e 100644 --- a/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c +++ b/drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c @@ -1909,9 +1909,9 @@ static int ov5693_probe(struct i2c_client *client) dev_err(&client->dev, "Error could not get ACPI device\n"); return -ENODEV; } - pr_info("%s: ACPI detected it on bus ID=%s, HID=%s\n", __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" |