Commit a1e627a
mmc: mmc_test: Fix NULL dereference on allocation failure
If the "test->highmem = alloc_pages()" allocation fails then calling
__free_pages(test->highmem) will result in a NULL dereference. Also
change the error code to -ENOMEM instead of returning success.
Fixes: 2661081 ("mmc_test: highmem tests")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/8c90be28-67b4-4b0d-a105-034dc72a0b31@stanley.mountain
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>1 parent 6275c7b commit a1e627a
1 file changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3125 | 3125 | | |
3126 | 3126 | | |
3127 | 3127 | | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
3128 | 3132 | | |
3129 | 3133 | | |
3130 | | - | |
3131 | | - | |
3132 | | - | |
3133 | 3134 | | |
3134 | | - | |
3135 | 3135 | | |
3136 | 3136 | | |
3137 | 3137 | | |
3138 | 3138 | | |
3139 | 3139 | | |
3140 | 3140 | | |
3141 | 3141 | | |
| 3142 | + | |
3142 | 3143 | | |
3143 | 3144 | | |
3144 | 3145 | | |
| |||
0 commit comments