Re: [PATCH] Avoid double close()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 30 Jul 2013 18:30:03 +0200 Jes.Sorensen@xxxxxxxxxx wrote:

> From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
> 
> Coverity discovered a possible double close(fd2) in Grow.c. Avoided by
> invalidating fd2 after the first close.
> 
> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
> ---
>  Grow.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Grow.c b/Grow.c
> index c1ae6e8..ff4ed5d 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -4685,6 +4685,8 @@ int Grow_continue_command(char *devname, int fd,
>  				continue;
>  			err = st->ss->load_super(st, fd2, NULL);
>  			close(fd2);
> +			/* invalidate fd2 to avoid possible double close() */
> +			fd2 = -1;
>  			if (err)
>  				continue;
>  			break;

Applied, thanks.

NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux