[PATCH v3 4/5] media: v4l2-subdev: v4l2_subdev_free_state() to accept a NULL state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make v4l2_subdev_free_state() accept a NULL state.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index dacae53b68d5..25c80d6de23b 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -931,7 +931,8 @@ EXPORT_SYMBOL_GPL(v4l2_subdev_alloc_state);
 
 void v4l2_subdev_free_state(struct v4l2_subdev_state *state)
 {
-	kvfree(state->pads);
+	if (state)
+		kvfree(state->pads);
 	kfree(state);
 }
 EXPORT_SYMBOL_GPL(v4l2_subdev_free_state);
-- 
2.25.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux