Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbdIXQWV (ORCPT ); Sun, 24 Sep 2017 12:22:21 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:55130 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbdIXQWT (ORCPT ); Sun, 24 Sep 2017 12:22:19 -0400 Date: Sun, 24 Sep 2017 18:21:35 +0200 (CEST) From: Stefan Wahren To: Phil Elwell , Aishwarya Pant , Eric Anholt , Greg Kroah-Hartman , Dan Carpenter , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Florian Fainelli , linux-rpi-kernel@lists.infradead.org Message-ID: <118921268.174494.1506270095800@email.1und1.de> In-Reply-To: <1506262849-9312-1-git-send-email-phil@raspberrypi.org> References: <1506262849-9312-1-git-send-email-phil@raspberrypi.org> Subject: Re: [PATCH v2 resend] staging: bcm2835-audio: Fix memory corruption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.3-Rev33 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K0:r+jUfLI8GSRkEp3TEQmq9w5U1tdttj0IBcWeUC4rUJTMcLoApdv oHNqTpU5VCqP5dJcn3oe6LCh09EVSqhm2LUxn0U5zejvorNcKrCLHqKmZW12vWvmfbeKyNe pOhNVWRxB+bcPdfPIXHEWQXp8fo8NdVpKWh1U24FP7eSSJSxTW2bveTRpAAGLWxQIi5Lj1n mv/GbgC4kigUgcPl5p0vA== X-UI-Out-Filterresults: notjunk:1;V01:K0:QGPLbyL2Iec=:chelpq/HFw++ICXDAlBN+G Mca2OxfAFcO3Uo2HCSZkfYPirs8NgMCV4CPLRhgiawVg8az+IkiBvFh+hswbrYBxrkFiOzDCC cWr4vzl3wiqs3z27vGEfIJpXkmLsbvOvMmFcgB95vIN+6nUMvbOeewecxTPCWhHrbLe6t8qwH UIix25EmEncGxox05BK7yHxc9rYj8IIODbIjdc33Lc84Kgbs7NX51SJy2v1TkG0CU8W3zxrsJ sVtpRzQ8py45Aovnmqy8bWaHr86vI0vOMuD9Aydfic7k7fkEIMEs8IC+f1eyJqy9qUeX8hQM6 2u8+/Gh7pj5aJ1byXPtrLCPG6fHgVEE5q2I7/TYPMY85XWbBb6Ko7EIP8ySKyHFpE4kMZrHUp 9u2ScojSiN3E2jTfktCmIb5lmClubCD6oV3dc/jdYEwzE8bOa3pJcBqMIxp+k7gsMgRauTtYZ jW4SwxKZVPg+szlZ+PmsVhp6MgUS6RLFPnqB6Pu9lrI9l6CUIM7/fvLIh9cyNQdb2LODGHO5s QDIt9buV/O3YSAJg4KHF0i3aALwuAgidQsbyoCPxSre9KeB3UgYn/P8R9vjmXE5m6Ev0Ok8Gh XLI1nmMP/l/madKmUziizxf5fwyb8mKiFRiFxda9ZBFiR5LNCoeh2acw8k70SWymUf1GqZlRo JoUNAeGsyUGqrUvWmS7el9H3+oWH5NGlskySq884alrxKozB1pIjAg7yVCDffIdmcglyY1y74 As2VTGUxgWkbZJo2hY14uGLGtMzW2O0X4Kk67bfaFefQNQmqKKbcw259o+w= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 698 Lines: 16 > Phil Elwell hat am 24. September 2017 um 16:20 geschrieben: > > > The previous commit (0adbfd46) fixed a memory leak but also freed a > block in the success case, causing a stale pointer to be used with > potentially fatal results. Only free the vchi_instance block in the > case that vchi_connect fails; once connected, the instance is > retained for subsequent connections. > > Simplifying the code by removing a bunch of gotos and returning errors > directly. > > Signed-off-by: Phil Elwell > Fixes: 0adbfd4694c2 ("staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection()") Tested-by: Stefan Wahren