Re: Possible memory leak in fs/sysfs/bin.c

From: Parag Warudkar
Date: Mon Jul 06 2009 - 19:12:45 EST


Hi

Catalin Marinas <catalin.marinas <at> arm.com> writes:


> --- a/fs/sysfs/bin.c
> +++ b/fs/sysfs/bin.c
> @@ -164,6 +164,7 @@ static ssize_t write(struct file *file, const char
> __user *userbuf,
> mutex_lock(&bb->mutex);
>
> memcpy(bb->buffer, temp, count);
> + kfree(temp);

Does the kfree() need to be inside the mutex_lock? Otherwise looks OK to me.

Parag




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/