summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2020-02-03 13:21:30 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-05 13:05:48 +0000
commit2e90738f1795456cfe615b90b836f1c7d5e30815 (patch)
tree8a84ac6c536c573cbb2d89230b80fc6c97da2b89 /drivers/media
parent9b6c072270b9da13e1a40b7b6c4fceb74a8b6ae9 (diff)
media: si470x-i2c: Move free() past last use of 'radio'
A pointer to 'struct si470x_device' is currently used after free: drivers/media/radio/si470x/radio-si470x-i2c.c:462:25-30: ERROR: reference preceded by free on line 460 Shift the call to free() down past its final use. NB: Not sending to Mainline, since the problem does not exist there, it was caused by the backport of 2df200ab234a ("media: si470x-i2c: add missed operations in remove") to the stable trees. Cc: <stable@vger.kernel.org> # v3.18+ Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/radio/si470x/radio-si470x-i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c
index fb69534a8b56..8f3086773db4 100644
--- a/drivers/media/radio/si470x/radio-si470x-i2c.c
+++ b/drivers/media/radio/si470x/radio-si470x-i2c.c
@@ -458,10 +458,10 @@ static int si470x_i2c_remove(struct i2c_client *client)
free_irq(client->irq, radio);
video_unregister_device(&radio->videodev);
- kfree(radio);
v4l2_ctrl_handler_free(&radio->hdl);
v4l2_device_unregister(&radio->v4l2_dev);
+ kfree(radio);
return 0;
}