* [PATCH] ASoC: hdmi-codec: Use devm_kcalloc() in hdmi_codec_probe()
@ 2017-04-26 10:48 ` SF Markus Elfring
0 siblings, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-04-26 10:48 UTC (permalink / raw)
To: alsa-devel, Arnaud Pouliquen, Jaroslav Kysela, Jon Medhurst,
Jyri Sarha, Kuninori Morimoto, Liam Girdwood, Mark Brown,
Philipp Zabel, Takashi Iwai, Vincent Abriou
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 26 Apr 2017 12:26:06 +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_kcalloc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
sound/soc/codecs/hdmi-codec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 8c5ae1fc23a9..99933488fa03 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -825,8 +825,7 @@ static int hdmi_codec_probe(struct platform_device *pdev)
hcp->hcd = *hcd;
mutex_init(&hcp->current_stream_lock);
-
- hcp->daidrv = devm_kzalloc(dev, dai_count * sizeof(*hcp->daidrv),
+ hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv),
GFP_KERNEL);
if (!hcp->daidrv)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ASoC: hdmi-codec: Use devm_kcalloc() in hdmi_codec_probe()
@ 2017-04-26 10:48 ` SF Markus Elfring
0 siblings, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-04-26 10:48 UTC (permalink / raw)
To: alsa-devel, Arnaud Pouliquen, Jaroslav Kysela, Jon Medhurst,
Jyri Sarha, Kuninori Morimoto, Liam Girdwood, Mark Brown,
Philipp Zabel, Takashi Iwai, Vincent Abriou
Cc: kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 26 Apr 2017 12:26:06 +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_kcalloc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
sound/soc/codecs/hdmi-codec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 8c5ae1fc23a9..99933488fa03 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -825,8 +825,7 @@ static int hdmi_codec_probe(struct platform_device *pdev)
hcp->hcd = *hcd;
mutex_init(&hcp->current_stream_lock);
-
- hcp->daidrv = devm_kzalloc(dev, dai_count * sizeof(*hcp->daidrv),
+ hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv),
GFP_KERNEL);
if (!hcp->daidrv)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ASoC: hdmi-codec: Use devm_kcalloc() in hdmi_codec_probe()
@ 2017-04-26 10:48 ` SF Markus Elfring
0 siblings, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-04-26 10:48 UTC (permalink / raw)
To: alsa-devel, Arnaud Pouliquen, Jaroslav Kysela, Jon Medhurst,
Jyri Sarha, Kuninori Morimoto, Liam Girdwood, Mark Brown,
Philipp Zabel, Takashi Iwai, Vincent Abriou
Cc: kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 26 Apr 2017 12:26:06 +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_kcalloc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
sound/soc/codecs/hdmi-codec.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 8c5ae1fc23a9..99933488fa03 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -825,8 +825,7 @@ static int hdmi_codec_probe(struct platform_device *pdev)
hcp->hcd = *hcd;
mutex_init(&hcp->current_stream_lock);
-
- hcp->daidrv = devm_kzalloc(dev, dai_count * sizeof(*hcp->daidrv),
+ hcp->daidrv = devm_kcalloc(dev, dai_count, sizeof(*hcp->daidrv),
GFP_KERNEL);
if (!hcp->daidrv)
return -ENOMEM;
--
2.12.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-26 10:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 10:48 [PATCH] ASoC: hdmi-codec: Use devm_kcalloc() in hdmi_codec_probe() SF Markus Elfring
2017-04-26 10:48 ` SF Markus Elfring
2017-04-26 10:48 ` SF Markus Elfring
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.