[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKMK7uG0i3eNnDG-LytPn02EwM7nb_8vbr9WRbVhbmjr3kkoQg@mail.gmail.com>
Date: Tue, 16 Feb 2016 13:45:45 +0100
From: Daniel Vetter <daniel@...ll.ch>
To: Gerd Hoffmann <kraxel@...hat.com>
Cc: David Airlie <airlied@...ux.ie>,
One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
"open list:DRM DRIVERS" <dri-devel@...ts.freedesktop.org>,
stable <stable@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] qxl: apply limit to relocs_num in qxl_process_single_command
On Tue, Feb 16, 2016 at 12:49 PM, Gerd Hoffmann <kraxel@...hat.com> wrote:
> + if (cmd->relocs_num > 65536)
> + return -EINVAL;
> reloc_info = kmalloc(sizeof(struct qxl_reloc_info) * cmd->relocs_num, GFP_KERNEL);
> if (!reloc_info)
> return -ENOMEM;
Why not just use one of the array alloc functions like kcalloc?
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Powered by blists - more mailing lists