Skip to content

Commit 72c9015

Browse files
tititiou36mchehab
authored andcommitted
media: smiapp: check memory allocation failure
Check memory allocation failure and return -ENOMEM in such a case. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 5160fb4 commit 72c9015

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/media/i2c/smiapp/smiapp-core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,8 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor)
841841
&client->dev,
842842
compressed_max_bpp - sensor->compressed_min_bpp + 1,
843843
sizeof(*sensor->valid_link_freqs), GFP_KERNEL);
844+
if (!sensor->valid_link_freqs)
845+
return -ENOMEM;
844846

845847
for (i = 0; i < ARRAY_SIZE(smiapp_csi_data_formats); i++) {
846848
const struct smiapp_csi_data_format *f =

0 commit comments

Comments
 (0)