Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c3f686f1 authored by Tobias Lorenz's avatar Tobias Lorenz Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (7108): radio-si470x.c: check-after-use



Adrian used the coverity checker against radio-si470x and found this:

> The Coverity checker spotted the following check-after-use in
> drivers/media/radio/radio-si470x.c:
>
> <--  snip  -->
> static void si470x_usb_driver_disconnect(struct usb_interface *intf)
> {
>         struct si470x_device *radio = usb_get_intfdata(intf);
>
>         del_timer_sync(&radio->timer);    <------------------
>         flush_scheduled_work();
>
>         usb_set_intfdata(intf, NULL);
>         if (radio) {                      <------------------
>                 video_unregister_device(radio->videodev);
>                 kfree(radio->buffer);
>                 kfree(radio);
>         }
> }
> <--  snip  -->
>
> Either "radio" can be NULL and this case has to be properly handled or
> the NULL check is not required.

These two lines should indeed better be inside the if statement.

Signed-off-by: default avatarTobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 532fe652
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment