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]
Message-ID: <a98c4b93-2e49-0d99-18dd-ac00446f3ca7@redhat.com>
Date:   Tue, 22 Nov 2016 16:51:25 +0100
From:   Tomas Henzl <thenzl@...hat.com>
To:     Quentin Lambert <lambert.quentin@...il.com>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] scsi: aic94xx: Add a missing call to kfree

On 19.11.2016 18:40, Quentin Lambert wrote:
> Most error branches following the call to kzalloc contain
> a call to kfree. This patch add these calls where they are
> missing.
>
> This issue was found with Hector.

Hi Quentin,
most error branches also do set the freed pointer to NULL,
please do the same.

tomash

> Signed-off-by: Quentin Lambert <lambert.quentin@...il.com>
>
> ---
>  drivers/scsi/aic94xx/aic94xx_hwi.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> --- a/drivers/scsi/aic94xx/aic94xx_hwi.c
> +++ b/drivers/scsi/aic94xx/aic94xx_hwi.c
> @@ -228,8 +228,10 @@ static int asd_init_scbs(struct asd_ha_s
>  	bitmap_bytes = (asd_ha->seq.tc_index_bitmap_bits+7)/8;
>  	bitmap_bytes = BITS_TO_LONGS(bitmap_bytes*8)*sizeof(unsigned long);
>  	asd_ha->seq.tc_index_bitmap = kzalloc(bitmap_bytes, GFP_KERNEL);
> -	if (!asd_ha->seq.tc_index_bitmap)
> +	if (!asd_ha->seq.tc_index_bitmap) {
> +		kfree(asd_ha->seq.tc_index_array);
>  		return -ENOMEM;
> +	}
>  
>  	spin_lock_init(&seq->tc_index_lock);
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ