From: Sakari Ailus Date: Tue, 11 Jun 2013 09:50:48 +0000 (-0300) Subject: [media] smiapp: Clean up media entity after unregistering subdev X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2a3e7256851b642f35c3bb550be77b815486b469;p=linux-beck.git [media] smiapp: Clean up media entity after unregistering subdev media_entity_cleanup() frees the links array which will be accessed by media_entity_remove_links() called by v4l2_device_unregister_subdev(). Signed-off-by: Sakari Ailus Reviewed-by: Sylwester Nawrocki Acked-by: Laurent Pinchart Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index c38545419045..7ac7580f85c9 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -2848,8 +2848,8 @@ static int smiapp_remove(struct i2c_client *client) device_remove_file(&client->dev, &dev_attr_nvm); for (i = 0; i < sensor->ssds_used; i++) { - media_entity_cleanup(&sensor->ssds[i].sd.entity); v4l2_device_unregister_subdev(&sensor->ssds[i].sd); + media_entity_cleanup(&sensor->ssds[i].sd.entity); } smiapp_free_controls(sensor);