Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1314161 > unrolled thread

Re: [PATCH v10 1/1] efi: a misc char interface for user to update efi firmware

Started byMatt Fleming <matt@console-pimps.org>
First post2016-01-21 13:40 +0100
Last post2016-01-21 13:40 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v10 1/1] efi: a misc char interface for user to update  efi firmware Matt Fleming <matt@console-pimps.org> - 2016-01-21 13:40 +0100

#1314161 — Re: [PATCH v10 1/1] efi: a misc char interface for user to update efi firmware

FromMatt Fleming <matt@console-pimps.org>
Date2016-01-21 13:40 +0100
SubjectRe: [PATCH v10 1/1] efi: a misc char interface for user to update efi firmware
Message-ID<qTmGS-5g3-19@gated-at.bofh.it>
On Mon, 21 Dec, at 05:04:11PM, Bryan O'Donoghue wrote:
> > +static int efi_capsule_open(struct inode *inode, struct file *file)
> > +{
> > +	struct capsule_info *cap_info;
> > +
> > +	cap_info = kzalloc(sizeof(*cap_info), GFP_KERNEL);
> > +	if (!cap_info)
> > +		return -ENOMEM;
> > +
> > +	file->private_data = cap_info;
> > +
> > +	return 0;
> > +}
> 
> You have a memory leak here don't you ?
> 
> if I do 
> for (i = 0; i < N; i++) {
> 	fd = open(/dev/your_node);
> 	close(fd);
> }
> 
> You'll leak that kzalloc...

Nope, it gets freed in efi_capsule_release(). Though the code does
leak cap_info->pages if a capsule is successfully submitted to the
firmware.

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web