usb/atm/ueagle-atm: Don't test for NULL ptr before calling release_firmware()
authorJesper Juhl <jj@chaosbits.net>
Mon, 9 Apr 2012 20:52:26 +0000 (22:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Apr 2012 20:52:35 +0000 (13:52 -0700)
release_firmware() deals gracefullt w/ NULL pointers, no need to check
first.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/atm/ueagle-atm.c

index 01ea5d7..d7e422d 100644 (file)
@@ -1357,10 +1357,8 @@ static int uea_stat_e1(struct uea_softc *sc)
                /* release the dsp firmware as it is not needed until
                 * the next failure
                 */
-               if (sc->dsp_firm) {
-                       release_firmware(sc->dsp_firm);
-                       sc->dsp_firm = NULL;
-               }
+               release_firmware(sc->dsp_firm);
+               sc->dsp_firm = NULL;
        }
 
        /* always update it as atm layer could not be init when we switch to
@@ -1496,10 +1494,8 @@ static int uea_stat_e4(struct uea_softc *sc)
                /* release the dsp firmware as it is not needed until
                 * the next failure
                 */
-               if (sc->dsp_firm) {
-                       release_firmware(sc->dsp_firm);
-                       sc->dsp_firm = NULL;
-               }
+               release_firmware(sc->dsp_firm);
+               sc->dsp_firm = NULL;
        }
 
        /* always update it as atm layer could not be init when we switch to
@@ -2240,8 +2236,7 @@ static void uea_stop(struct uea_softc *sc)
        /* flush the work item, when no one can schedule it */
        flush_work_sync(&sc->task);
 
-       if (sc->dsp_firm)
-               release_firmware(sc->dsp_firm);
+       release_firmware(sc->dsp_firm);
        uea_leaves(INS_TO_USBDEV(sc));
 }