Skip to content

Commit

Permalink
ALSA: sgio2audio: Improve a size determination in snd_sgio2audio_crea…
Browse files Browse the repository at this point in the history
…te()

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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
elfring authored and tiwai committed Nov 29, 2017
1 parent 044ace5 commit cdc4398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/mips/sgio2audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ static int snd_sgio2audio_create(struct snd_card *card,
if (!(readq(&mace->perif.audio.control) & AUDIO_CONTROL_CODEC_PRESENT))
return -ENOENT;

chip = kzalloc(sizeof(struct snd_sgio2audio), GFP_KERNEL);
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;

Expand Down

0 comments on commit cdc4398

Please sign in to comment.