linux_dsm_epyc7002/drivers/gpu/drm/qxl
Gustavo A. R. Silva d4b9dd5007 qxl: Use struct_size() in kzalloc()
One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:

struct foo {
    int stuff;
    void *entry[];
};

instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:

instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20190108162152.GA25361@embeddedor
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-01-09 09:38:49 +01:00
..
Kconfig drm: fix compilations issues introduced by "drm: allow to use mmuless SoC" 2017-01-09 11:30:30 +01:00
Makefile drm/qxl: fix include notation and remove -Iinclude/drm flag 2017-05-17 14:36:17 +02:00
qxl_cmd.c drm/qxl: Use 'unsigned int' instead of 'usigned' 2018-10-30 07:20:00 +01:00
qxl_debugfs.c drm/qxl: Use 'unsigned int' instead of 'usigned' 2018-10-30 07:20:00 +01:00
qxl_dev.h drm/qxl: Remove exceding whiteline 2018-10-30 07:19:59 +01:00
qxl_display.c qxl: Use struct_size() in kzalloc() 2019-01-09 09:38:49 +01:00
qxl_draw.c qxl: No need for NULL check before calling qxl_bo_unref() 2018-11-21 09:12:45 +01:00
qxl_drv.c qxl: fix null-pointer crash during suspend 2018-09-05 08:26:24 +02:00
qxl_drv.h Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next 2018-11-19 11:07:52 +10:00
qxl_dumb.c drm/qxl: Add line after variable declarations 2018-10-30 07:19:59 +01:00
qxl_fb.c qxl: Remove unused qxl_bo_pin arguments 2018-11-21 09:12:45 +01:00
qxl_gem.c drm/qxl: Replace ttm_bo_unref with ttm_bo_put 2018-08-30 09:41:01 +02:00
qxl_image.c drm/qxl: Use 'unsigned int' instead of 'usigned' 2018-10-30 07:20:00 +01:00
qxl_ioctl.c drm/qxl: Add line after variable declarations 2018-10-30 07:19:59 +01:00
qxl_irq.c qxl: remove qxl_io_log() 2018-04-27 08:58:04 +02:00
qxl_kms.c qxl: No need for NULL check before calling qxl_bo_unref() 2018-11-21 09:12:45 +01:00
qxl_object.c qxl: Remove unused qxl_bo_pin arguments 2018-11-21 09:12:45 +01:00
qxl_object.h qxl: Remove unused qxl_bo_pin arguments 2018-11-21 09:12:45 +01:00
qxl_prime.c drm/qxl: Remove exceding whiteline 2018-10-30 07:19:59 +01:00
qxl_release.c drm/qxl: remove set but not used variables 'driver, qbo' 2018-11-14 14:21:04 +01:00
qxl_ttm.c Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next 2018-11-19 11:07:52 +10:00