Skip to content

Commit

Permalink
ALSA: remove unnecessary null check
Browse files Browse the repository at this point in the history
This function is only called from snd_ctl_ioctl() and the file parameter
can never be null so there is no need to check it here.

We dereference file at the start of the function:
        struct snd_card *card = file->card;
and it confuses static checkers to dereference a pointer before
checking it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Dan Carpenter authored and Takashi Iwai committed Nov 18, 2009
1 parent 67f2db2 commit bec145a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ static int snd_ctl_tlv_ioctl(struct snd_ctl_file *file,
goto __kctl_end;
}
if (vd->access & SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK) {
if (file && vd->owner != NULL && vd->owner != file) {
if (vd->owner != NULL && vd->owner != file) {
err = -EPERM;
goto __kctl_end;
}
Expand Down

0 comments on commit bec145a

Please sign in to comment.