From: SF Markus Elfring <elfring@users.sourceforge.net>
To: alsa-devel@alsa-project.org, Bhumika Goyal <bhumirks@gmail.com>,
Dan Carpenter <dan.carpenter@oracle.com>,
Fabian Frederick <fabf@skynet.be>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/4] ALSA: cs46xx: Improve a size determination in cs46xx_dsp_proc_register_scb_desc()
Date: Mon, 13 Nov 2017 19:24:38 +0100 [thread overview]
Message-ID: <48771e1a-f520-3f80-16ad-ef2dbcb15a63@users.sourceforge.net> (raw)
In-Reply-To: <893b1dc2-d078-9ea6-4ad2-0e0327affddd@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 13 Nov 2017 18:56:58 +0100
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
sound/pci/cs46xx/dsp_spos_scb_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index f9564f42eb09..bccd315e6c18 100644
--- a/sound/pci/cs46xx/dsp_spos_scb_lib.c
+++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c
@@ -260,7 +260,7 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
scb->scb_name,
ins->proc_dsp_dir);
if (entry) {
- scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL);
+ scb_info = kmalloc(sizeof(*scb_info), GFP_KERNEL);
if (!scb_info) {
snd_info_free_entry(entry);
entry = NULL;
--
2.15.0
next prev parent reply other threads:[~2017-11-13 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 18:21 [PATCH 0/4] ALSA: cs46xx: Adjustments for some function implementations SF Markus Elfring
2017-11-13 18:22 ` [PATCH 1/4] ALSA: cs46xx: Adjust 33 function calls together with a variable assignment SF Markus Elfring
2017-11-13 18:30 ` Dan Carpenter
2017-11-13 18:23 ` [PATCH 2/4] ALSA: cs46xx: Use common error handling code in two functions SF Markus Elfring
2017-11-13 18:24 ` SF Markus Elfring [this message]
2017-11-13 18:25 ` [PATCH 4/4] ALSA: cs46xx: Adjust 35 checks for null pointers SF Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48771e1a-f520-3f80-16ad-ef2dbcb15a63@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=alsa-devel@alsa-project.org \
--cc=bhumirks@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=fabf@skynet.be \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=o-takashi@sakamocchi.jp \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome