USB: Don't dereference snd->filp
PATCH 1/1 USB: Don't dereference snd->filp
Don't dereference snd->filp.
Signed-off-by Roel Kluin <[email protected]>
--- drivers/usb/gadget/u_audio.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Or should it return the error pointer?
drivers/usb/gadget/u_audio.c +1 -0
@@ -242,6 +242,7 @@ static int gaudio_open_snd_dev(struct gaudio *card)if (IS_ERR (snd->filp)) {ERROR (card,"No such PCM playback device: %s\n" , fn_play); snd->filp =NULL ; +return 0 ; } pcm_file = snd->filp->private_data; snd->substream = pcm_file->substream;
Quoted 8 lines · Roel Kluin
Don't dereference
snd->filp.Signed-off-by Roel Kluin <[email protected]>--- drivers/usb/gadget/u_audio.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)Or should it return the error pointer?
Probably, what happens if you do?
thanks,
greg k-h