Re: [PATCH] afs: Fix the memory leak in afs_mkdir

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

 



…
> +++ b/fs/afs/dir.c
> @@ -1599,17 +1599,17 @@ static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
…
>  	scb = kcalloc(2, sizeof(struct afs_status_cb), GFP_KERNEL);
>  	if (!scb)
>  		goto error_scb;

I suggest to adjust also this jump target so that a call of the function “kfree”
with a null pointer can be avoided.


…
> @@ -1645,10 +1645,10 @@  static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
…
>  error_key:
>  	key_put(key);
> +error_scb:
> +	kfree(scb);
>  error:
>  	d_drop(dentry);
…

Can an other label than “error” be nicer here?

Regards,
Markus




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux