Re: [patch] drm/radeon: check for allocation failure in radeon_ring_backup()

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

 



On Fri, Jul 20, 2012 at 03:45:28PM +0200, Christian König wrote:
> On 20.07.2012 13:17, Dan Carpenter wrote:
> >Static checkers complain if this we don't check for allocation failure.
> >Also we can use the new kmalloc_array() function here as a cleanup.
> >
> >Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> What's the benefit of using kmalloc_array instead of just kmalloc?
> 

It has built in integer overflow protection.  Whenever I see
multiplication in kmalloc(), I automatically start to audit for
overflows, but now, ha ha, just change it to kmalloc_array() and
forget about it.  (There weren't any integer overflow problems
in the original code, btw).

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux