提交 51b5b3d6 编写于 作者: K Kiran Padwal 提交者: Mauro Carvalho Chehab

[media] s5k5baf: Add missing error check for devm_kzalloc

This patch add a missing a check on the return value of devm_kzalloc,
which would cause a NULL pointer dereference in a OOM situation.
Signed-off-by: NKiran Padwal <kiran.padwal@smartplayin.com>
Acked-by: NAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 5ed1c328
......@@ -374,6 +374,8 @@ static int s5k5baf_fw_parse(struct device *dev, struct s5k5baf_fw **fw,
count -= S5K5BAG_FW_TAG_LEN;
d = devm_kzalloc(dev, count * sizeof(u16), GFP_KERNEL);
if (!d)
return -ENOMEM;
for (i = 0; i < count; ++i)
d[i] = le16_to_cpu(data[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册