Staging: me4000: kfree(NULL) is safe, so no extra checks needed.
authorAndre Haupt <andre@bitwigglers.org>
Mon, 26 Jan 2009 15:12:21 +0000 (16:12 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:24 +0000 (14:53 -0700)
Signed-off-by: Andre Haupt <andre@bitwigglers.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/me4000/me4000.c

index 8f0dbcc613fd14e4733925acb890323c4a51fdec..bfdf3e17d371704ec48d8f04a3ed717247546ae2 100644 (file)
@@ -546,15 +546,13 @@ static void clear_board_info_list(void)
                                &board_info->ao_context_list, list) {
                        me4000_ao_reset(ao_context);
                        free_irq(ao_context->irq, ao_context);
-                       if (ao_context->circ_buf.buf)
-                               kfree(ao_context->circ_buf.buf);
+                       kfree(ao_context->circ_buf.buf);
                        list_del(&ao_context->list);
                        kfree(ao_context);
                }
 
                /* Clear analog input context */
-               if (board_info->ai_context->circ_buf.buf)
-                       kfree(board_info->ai_context->circ_buf.buf);
+               kfree(board_info->ai_context->circ_buf.buf);
                kfree(board_info->ai_context);
 
                /* Clear digital I/O context */
@@ -3668,8 +3666,7 @@ AI_CONFIG_ERR:
        tmp &=
            ~(ME4000_AI_CTRL_BIT_CHANNEL_FIFO | ME4000_AI_CTRL_BIT_SAMPLE_HOLD);
 
-       if (list)
-               kfree(list);
+       kfree(list);
 
        return err;