Commit 4c25384d authored by Yang Yingliang's avatar Yang Yingliang Committed by Mauro Carvalho Chehab

media: camss: csid: fix wrong size passed to devm_kmalloc_array()

'supplies' is a pointer, the real size of struct regulator_bulk_data
should be pass to devm_kmalloc_array().

Fixes: 0d814017 ("media: camss: Add regulator_bulk support")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent c984fcb1
...@@ -666,7 +666,7 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid, ...@@ -666,7 +666,7 @@ int msm_csid_subdev_init(struct camss *camss, struct csid_device *csid,
if (csid->num_supplies) { if (csid->num_supplies) {
csid->supplies = devm_kmalloc_array(camss->dev, csid->supplies = devm_kmalloc_array(camss->dev,
csid->num_supplies, csid->num_supplies,
sizeof(csid->supplies), sizeof(*csid->supplies),
GFP_KERNEL); GFP_KERNEL);
if (!csid->supplies) if (!csid->supplies)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment