media: si470x-i2c: Move free() past last use of 'radio'
authorLee Jones <lee.jones@linaro.org>
Mon, 3 Feb 2020 13:21:30 +0000 (13:21 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Feb 2020 14:18:17 +0000 (14:18 +0000)
commitc7d812223d2241b331e60df738918f05b93173ac
tree03dd5d2136baa1a341ccb7a5dee6ce1331498391
parent060af799ef5a17a4a6dc3e95c1bacb51fa6ebec7
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>
drivers/media/radio/si470x/radio-si470x-i2c.c