]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: usx2y: remove an unneeded check
authorDan Carpenter <dan.carpenter@oracle.com>
Sun, 28 Jul 2013 20:27:38 +0000 (23:27 +0300)
committerTakashi Iwai <tiwai@suse.de>
Mon, 29 Jul 2013 11:59:47 +0000 (13:59 +0200)
The test here is always true because S[i].urb is an array not a pointer.
Also it's bogus because the intent was to test:
if (S->urb[i]) {
instead of:
if (S[i].urb) {

Anyway, usb_kill_urb() and usb_free_urb() accept NULL pointers so we can
just remove this.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/usx2y/usbusx2y.c

index 1f9bbd55553fc79bd539b8ad17f369be5beed267..5a51b18c50fe9230faabb923219c281b45a47970 100644 (file)
@@ -305,11 +305,9 @@ static void usX2Y_unlinkSeq(struct snd_usX2Y_AsyncSeq *S)
 {
        int     i;
        for (i = 0; i < URBS_AsyncSeq; ++i) {
-               if (S[i].urb) {
-                       usb_kill_urb(S->urb[i]);
-                       usb_free_urb(S->urb[i]);
-                       S->urb[i] = NULL;
-               }
+               usb_kill_urb(S->urb[i]);
+               usb_free_urb(S->urb[i]);
+               S->urb[i] = NULL;
        }
        kfree(S->buffer);
 }