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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Feb 2015 13:14:11 -0500
From:	Douglas Gilbert <dgilbert@...erlog.com>
To:	SF Markus Elfring <elfring@...rs.sourceforge.net>,
	"James E. J. Bottomley" <JBottomley@...allels.com>,
	linux-scsi@...r.kernel.org
CC:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 1/3] SCSI-debug: Deletion of unnecessary checks before
 the function call "vfree"

On 15-02-06 12:23 PM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Fri, 6 Feb 2015 16:56:57 +0100
>
> The vfree() function performs also input parameter validation.
> Thus the test around the call is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>

Acked-by: Douglas Gilbert <dgilbert@...erlog.com>

> ---
>   drivers/scsi/scsi_debug.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index 1132321..9e4add7 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -4969,12 +4969,9 @@ bus_unreg:
>   dev_unreg:
>   	root_device_unregister(pseudo_primary);
>   free_vm:
> -	if (map_storep)
> -		vfree(map_storep);
> -	if (dif_storep)
> -		vfree(dif_storep);
> +	vfree(map_storep);
> +	vfree(dif_storep);
>   	vfree(fake_storep);
> -
>   	return ret;
>   }
>
> @@ -4989,10 +4986,7 @@ static void __exit scsi_debug_exit(void)
>   	driver_unregister(&sdebug_driverfs_driver);
>   	bus_unregister(&pseudo_lld_bus);
>   	root_device_unregister(pseudo_primary);
> -
> -	if (dif_storep)
> -		vfree(dif_storep);
> -
> +	vfree(dif_storep);
>   	vfree(fake_storep);
>   }
>
>

--
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