Unchecked memory allocations in Intel driver

Alan Cox alan at lxorguk.ukuu.org.uk
Mon Jul 4 12:55:20 PDT 2011


On Mon, 04 Jul 2011 11:18:13 -0700
Keith Packard <keithp at keithp.com> wrote:

> On Mon, 4 Jul 2011 13:27:51 +0100, Alan Cox <alan at lxorguk.ukuu.org.uk> wrote:
> > Found this going over intel_bios.c and cross comparing it with the
> > Intel/IMG driver intel_bios.c
> > 
> >         temp_mode = kzalloc(sizeof(*temp_mode), GFP_KERNEL);
> 
> This object is about 216 bytes long; would it be reasonable to allocate
> it on the stack? Or is that pushing stack allocations too far?

You'd have to review the rest of the call stack. Its pretty borderline.

Alan


More information about the dri-devel mailing list