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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 29 Oct 2019 12:22:47 +0100
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Saurav Girepunje <saurav.girepunje@...il.com>
Cc:     joern@...ybastard.org, dwmw2@...radead.org,
        computersforpeace@...il.com, marek.vasut@...il.com, richard@....at,
        vigneshr@...com, linux-mtd@...ts.infradead.org,
        linux-kernel@...r.kernel.org, saurav.girepunje@...mail.com
Subject: Re: [PATCH] mtd: devices: phram.c: Fix multiple kfree statement
 from phram_setup

Hi Saurav,

Saurav Girepunje <saurav.girepunje@...il.com> wrote on Mon, 28 Oct 2019
23:43:01 +0530:

> Remove multiple kfree statement from phram_setup() in phram.c
> 
> Signed-off-by: Saurav Girepunje <saurav.girepunje@...il.com>
> ---

Here you should add a changelog with the changes you have done since
the last version.

Also when formatting the patch use -v <x> to add a version prefix
into the title, like [PATCH v<x>].

>  drivers/mtd/devices/phram.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
> index c467286ca007..38f95a1517ac 100644
> --- a/drivers/mtd/devices/phram.c
> +++ b/drivers/mtd/devices/phram.c
> @@ -243,22 +243,22 @@ static int phram_setup(const char *val)
>  
>  	ret = parse_num64(&start, token[1]);
>  	if (ret) {
> -		kfree(name);
>  		parse_err("illegal start address\n");
> +		goto free_nam;

s/nam/name

>  	}
>  
>  	ret = parse_num64(&len, token[2]);
>  	if (ret) {
> -		kfree(name);
>  		parse_err("illegal device length\n");
> +		goto free_nam;
>  	}
>  
>  	ret = register_device(name, start, len);
>  	if (!ret)
>  		pr_info("%s device: %#llx at %#llx\n", name, len, start);
> -	else
> -		kfree(name);
>  
> +free_nam:
> +	kfree(name);
>  	return ret;
>  }
>  

Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ