media: smiapp: check memory allocation failure
Check memory allocation failure and return -ENOMEM in such a case. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
5160fb4bbd
commit
72c901582c
|
@ -841,6 +841,8 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor)
|
|||
&client->dev,
|
||||
compressed_max_bpp - sensor->compressed_min_bpp + 1,
|
||||
sizeof(*sensor->valid_link_freqs), GFP_KERNEL);
|
||||
if (!sensor->valid_link_freqs)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(smiapp_csi_data_formats); i++) {
|
||||
const struct smiapp_csi_data_format *f =
|
||||
|
|
Loading…
Reference in New Issue