diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-02-25 07:56:21 -0500 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-03-04 18:04:40 -0500 |
commit | a09b09ae51ace43d28cd9bc1c8bb97986f2b55a6 (patch) | |
tree | a70862b01fc038b92067faf13f623ce5b9492105 /drivers/dma | |
parent | 900325a6ce33995688b7a680a34e7698f16f4d72 (diff) |
iop-adma, mv_xor: fix mem leak on self-test setup failure
iop_adma_zero_sum_self_test has the brackets in the wrong place for the
setup failure deallocation path. This error was duplicated in
mv_xor_xor_self_test.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/iop-adma.c | 16 | ||||
-rw-r--r-- | drivers/dma/mv_xor.c | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c index ea5440dd10dc..4131ab8e5032 100644 --- a/drivers/dma/iop-adma.c +++ b/drivers/dma/iop-adma.c | |||
@@ -928,19 +928,19 @@ iop_adma_xor_zero_sum_self_test(struct iop_adma_device *device) | |||
928 | 928 | ||
929 | for (src_idx = 0; src_idx < IOP_ADMA_NUM_SRC_TEST; src_idx++) { | 929 | for (src_idx = 0; src_idx < IOP_ADMA_NUM_SRC_TEST; src_idx++) { |
930 | xor_srcs[src_idx] = alloc_page(GFP_KERNEL); | 930 | xor_srcs[src_idx] = alloc_page(GFP_KERNEL); |
931 | if (!xor_srcs[src_idx]) | 931 | if (!xor_srcs[src_idx]) { |
932 | while (src_idx--) { | 932 | while (src_idx--) |
933 | __free_page(xor_srcs[src_idx]); | 933 | __free_page(xor_srcs[src_idx]); |
934 | return -ENOMEM; | 934 | return -ENOMEM; |
935 | } | 935 | } |
936 | } | 936 | } |
937 | 937 | ||
938 | dest = alloc_page(GFP_KERNEL); | 938 | dest = alloc_page(GFP_KERNEL); |
939 | if (!dest) | 939 | if (!dest) { |
940 | while (src_idx--) { | 940 | while (src_idx--) |
941 | __free_page(xor_srcs[src_idx]); | 941 | __free_page(xor_srcs[src_idx]); |
942 | return -ENOMEM; | 942 | return -ENOMEM; |
943 | } | 943 | } |
944 | 944 | ||
945 | /* Fill in src buffers */ | 945 | /* Fill in src buffers */ |
946 | for (src_idx = 0; src_idx < IOP_ADMA_NUM_SRC_TEST; src_idx++) { | 946 | for (src_idx = 0; src_idx < IOP_ADMA_NUM_SRC_TEST; src_idx++) { |
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index d35cbd1ff0b3..2a4e3e30a046 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -1019,19 +1019,19 @@ mv_xor_xor_self_test(struct mv_xor_device *device) | |||
1019 | 1019 | ||
1020 | for (src_idx = 0; src_idx < MV_XOR_NUM_SRC_TEST; src_idx++) { | 1020 | for (src_idx = 0; src_idx < MV_XOR_NUM_SRC_TEST; src_idx++) { |
1021 | xor_srcs[src_idx] = alloc_page(GFP_KERNEL); | 1021 | xor_srcs[src_idx] = alloc_page(GFP_KERNEL); |
1022 | if (!xor_srcs[src_idx]) | 1022 | if (!xor_srcs[src_idx]) { |
1023 | while (src_idx--) { | 1023 | while (src_idx--) |
1024 | __free_page(xor_srcs[src_idx]); | 1024 | __free_page(xor_srcs[src_idx]); |
1025 | return -ENOMEM; | 1025 | return -ENOMEM; |
1026 | } | 1026 | } |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | dest = alloc_page(GFP_KERNEL); | 1029 | dest = alloc_page(GFP_KERNEL); |
1030 | if (!dest) | 1030 | if (!dest) { |
1031 | while (src_idx--) { | 1031 | while (src_idx--) |
1032 | __free_page(xor_srcs[src_idx]); | 1032 | __free_page(xor_srcs[src_idx]); |
1033 | return -ENOMEM; | 1033 | return -ENOMEM; |
1034 | } | 1034 | } |
1035 | 1035 | ||
1036 | /* Fill in src buffers */ | 1036 | /* Fill in src buffers */ |
1037 | for (src_idx = 0; src_idx < MV_XOR_NUM_SRC_TEST; src_idx++) { | 1037 | for (src_idx = 0; src_idx < MV_XOR_NUM_SRC_TEST; src_idx++) { |