Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1623593 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-04-14 11:20 +0200 |
| Last post | 2017-04-14 11:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 05/10] pinctrl: imx: Use devm_kmalloc_array() in imx_pinctrl_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-14 11:20 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-14 11:20 +0200 |
| Subject | [PATCH 05/10] pinctrl: imx: Use devm_kmalloc_array() in imx_pinctrl_probe() |
| Message-ID | <tw5yx-7IM-1@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Thu, 13 Apr 2017 15:35:27 +0200 A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kmalloc_array". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/pinctrl/freescale/pinctrl-imx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 44dbf6e38d79..078875361d76 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -726,8 +726,10 @@ int imx_pinctrl_probe(struct platform_device *pdev, if (!ipctl) return -ENOMEM; - info->pin_regs = devm_kmalloc(&pdev->dev, sizeof(*info->pin_regs) * - info->npins, GFP_KERNEL); + info->pin_regs = devm_kmalloc_array(&pdev->dev, + info->npins, + sizeof(*info->pin_regs), + GFP_KERNEL); if (!info->pin_regs) return -ENOMEM; -- 2.12.2
Back to top | Article view | linux.kernel
csiph-web