From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Valo Subject: Re: [V3] mt7601u: do not free dma_buf when ivp allocation fails Date: Mon, 7 Mar 2016 12:39:54 +0000 (UTC) Message-ID: <20160307123954.8575E60375@smtp.codeaurora.org> References: <1456442667-19751-1-git-send-email-colin.king@canonical.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Jakub Kicinski , netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Matthias Brugger , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Colin Ian King Return-path: In-Reply-To: <1456442667-19751-1-git-send-email-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+glpam-linux-mediatek=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: netdev.vger.kernel.org > From: Colin Ian King > > 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 > Reviewed-by: Julian Calaby Thanks, applied to wireless-drivers-next.git. Kalle Valo