Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: renesas: vsp1: Fix NULL pointer deref on module unload

When unloading the module on gen 4, we hit a NULL pointer dereference.
This is caused by the cleanup code calling vsp1_drm_cleanup() where it
should be calling vsp1_vspx_cleanup().

Fix this by checking the IP version and calling the drm or vspx function
accordingly, the same way as the init code does.

Fixes: d06c1a9f348d ("media: vsp1: Add VSPX support")
Cc: stable@vger.kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Tomi Valkeinen and committed by
Hans Verkuil
58b1e966 8015a49d

+6 -2
+6 -2
drivers/media/platform/renesas/vsp1/vsp1_drv.c
··· 240 240 media_device_unregister(&vsp1->media_dev); 241 241 media_device_cleanup(&vsp1->media_dev); 242 242 243 - if (!vsp1->info->uapi) 244 - vsp1_drm_cleanup(vsp1); 243 + if (!vsp1->info->uapi) { 244 + if (vsp1->info->version == VI6_IP_VERSION_MODEL_VSPX_GEN4) 245 + vsp1_vspx_cleanup(vsp1); 246 + else 247 + vsp1_drm_cleanup(vsp1); 248 + } 245 249 } 246 250 247 251 static int vsp1_create_entities(struct vsp1_device *vsp1)