mt7601u: do not free dma_buf when ivp allocation fails
authorColin Ian King <colin.king@canonical.com>
Thu, 25 Feb 2016 23:24:27 +0000 (23:24 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 7 Mar 2016 12:39:05 +0000 (14:39 +0200)
commit2b02a36d12192f2a86388913143cd1e399eb971c
treefb62b77021babc4c21196bfcde25cc63f4cec9ae
parent354a1947a02528b19ee326e230cb44399cd31865
mt7601u: do not free dma_buf when ivp allocation fails

If the allocation of ivp fails the error handling attempts to
free an uninitialized dma_buf; this data structure just contains
garbage on the stack, so the freeing will cause issues when the
urb, buf and dma fields are free'd. Fix this by not free'ing the
dma_buf if the ivp allocation fails.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt7601u/mcu.c