mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-11 15:14:03 +08:00
drm: Prefer kmalloc_array() over kmalloc() with multiply
Fixes a couple of checkpatch warnings regarding the use of kmalloc() with a multiplication. kmalloc_array() is the preferred API. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
bd3f0ff98a
commit
2f6c538924
@ -1174,7 +1174,7 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
|
||||
plane->base.properties = &plane->properties;
|
||||
plane->dev = dev;
|
||||
plane->funcs = funcs;
|
||||
plane->format_types = kmalloc(sizeof(uint32_t) * format_count,
|
||||
plane->format_types = kmalloc_array(format_count, sizeof(uint32_t),
|
||||
GFP_KERNEL);
|
||||
if (!plane->format_types) {
|
||||
DRM_DEBUG_KMS("out of memory when allocating plane\n");
|
||||
@ -2705,7 +2705,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
|
||||
goto out;
|
||||
}
|
||||
|
||||
connector_set = kmalloc(crtc_req->count_connectors *
|
||||
connector_set = kmalloc_array(crtc_req->count_connectors,
|
||||
sizeof(struct drm_connector *),
|
||||
GFP_KERNEL);
|
||||
if (!connector_set) {
|
||||
|
Loading…
Reference in New Issue
Block a user