Skip to content

Commit 044ace5

Browse files
elfringtiwai
authored andcommitted
ALSA: hal2: Improve a size determination in hal2_create()
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> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent a4a1b73 commit 044ace5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sound/mips/hal2.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ static int hal2_create(struct snd_card *card, struct snd_hal2 **rchip)
814814
struct hpc3_regs *hpc3 = hpc3c0;
815815
int err;
816816

817-
hal2 = kzalloc(sizeof(struct snd_hal2), GFP_KERNEL);
817+
hal2 = kzalloc(sizeof(*hal2), GFP_KERNEL);
818818
if (!hal2)
819819
return -ENOMEM;
820820

0 commit comments

Comments
 (0)