Browse Source

staging: sep: fix possible memory leak in sep_prepare_input_dma_table()

'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>
Wei Yongjun 12 years ago
parent
commit
13b47d5f79
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/staging/sep/sep_main.c

+ 1 - 1
drivers/staging/sep/sep_main.c

@@ -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;
 	}