]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: sep: fix possible memory leak in sep_prepare_input_dma_table()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 15 Mar 2013 09:20:08 +0000 (17:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Mar 2013 16:05:36 +0000 (09:05 -0700)
'lli_array_ptr' etc. are malloced in sep_prepare_input_dma_table() and should
be freed before leaving from the error handling case, otherwise it will cause
memory leak.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sep/sep_main.c

index f5b73419eebca6124afad538652a0c0c7ba1941b..6a98a208bbf2895b0a978cd10658edf7e7f51ae0 100644 (file)
@@ -1986,7 +1986,7 @@ static int sep_prepare_input_dma_table(struct sep_device *sep,
                                        dma_ctx,
                                        sep_lli_entries);
                if (error)
-                       return error;
+                       goto end_function_error;
                lli_table_alloc_addr = *dmatables_region;
        }