summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2017-08-24 01:58:39 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-26 20:15:13 -0400
commit72c901582c366da670181b9a13dea28d2078b905 (patch)
tree6e5837213f7ba516d29681be7886c218bdfd371e /drivers/media
parent5160fb4bbd7add491b93fbf859cae5804f3de8bf (diff)
downloadlinux-72c901582c366da670181b9a13dea28d2078b905.tar.bz2
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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/i2c/smiapp/smiapp-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index aff55e1dffe7..700f433261d0 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -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 =