lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAVeFu+rRSXfrVGDz4piMmeHAMkWGsL5caukAN1w9DNH38D9FQ@mail.gmail.com>
Date:	Thu, 21 May 2015 14:27:59 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	Jon Hunter <jonathanh@...dia.com>
Cc:	Alexandre Courbot <acourbot@...dia.com>,
	Laxman Dewangan <ldewangan@...dia.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jiri Slaby <jslaby@...e.cz>, linux-serial@...r.kernel.org,
	"linux-tegra@...r.kernel.org" <linux-tegra@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] serial: tegra: Fix memory leak on DMA setup failure

On Wed, May 20, 2015 at 8:21 PM, Jon Hunter <jonathanh@...dia.com> wrote:
> If the call to dmaengine_slave_config() fails, then the DMA buffer will
> not be freed/unmapped. Fix this by moving the code that stores the
> address of the buffer in the tegra_uart_port structure to before the
> call to dmaengine_slave_config().
>
> Reported-by: Alexandre Courbot <acourbot@...dia.com>
> Signed-off-by: Jon Hunter <jonathanh@...dia.com>

Looks good, we had the same if/else condition appearing three times in
this function for no real reason anyway. This considerably simplifies
the code.

>  drivers/tty/serial/serial-tegra.c | 32 +++++++++++---------------------
>  1 file changed, 11 insertions(+), 21 deletions(-)

Negative number of lines, another good point for this patch!

Reviewed-by: Alexandre Courbot <acourbot@...dia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ