Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1585772
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 4/7] drm/sun4i: Fix kcalloc element size in sun4i_layers_init |
| Date | 2017-02-21 23:20 +0100 |
| Message-ID | <tdqWS-l3-11@gated-at.bofh.it> (permalink) |
| References | <tbHfr-77T-3@gated-at.bofh.it> <tbHfr-77T-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Fri, Feb 17, 2017 at 11:13:27AM +0800, Chen-Yu Tsai wrote: > In sun4i_layers_init we are allocating an array of pointers to struct > sun4i_layer: > > layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes), > sizeof(**layers), GFP_KERNEL); > > The element size should be the size of an individual element of the > array. Change it to sizeof(*layers) to avoid wasting a lot of memory. > > Signed-off-by: Chen-Yu Tsai <wens@csie.org> Applied, thanks! Maxime -- Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/7] drm/sun4i: Various fixes and cleanups part 1 Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
[PATCH 4/7] drm/sun4i: Fix kcalloc element size in sun4i_layers_init Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
Re: [PATCH 4/7] drm/sun4i: Fix kcalloc element size in sun4i_layers_init Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-21 23:20 +0100
[PATCH 1/7] drm/sun4i: Move drm_mode_config_cleanup call to main driver Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
Re: [PATCH 1/7] drm/sun4i: Move drm_mode_config_cleanup call to main driver Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-21 21:30 +0100
[PATCH 5/7] drm/sun4i: Drop useless assignment in sun4i_layers_init Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
Re: [PATCH 5/7] drm/sun4i: Drop useless assignment in sun4i_layers_init Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-21 23:20 +0100
[PATCH 3/7] drm/sun4i: Check return value of drm_vblank_init Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
Re: [PATCH 3/7] drm/sun4i: Check return value of drm_vblank_init Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-21 23:20 +0100
[PATCH 6/7] drm/sun4i: Save newly created layer in layers array in sun4i_layers_init Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
Re: [PATCH 6/7] drm/sun4i: Save newly created layer in layers array in sun4i_layers_init Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-21 23:20 +0100
[PATCH 7/7] drm/sun4i: Make sun4i_crtc_init return ERR_PTR style error codes Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
Re: [PATCH 7/7] drm/sun4i: Make sun4i_crtc_init return ERR_PTR style error codes Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-21 23:20 +0100
[PATCH 2/7] drm/sun4i: Fix up error path cleanup for master bind function Chen-Yu Tsai <wens@csie.org> - 2017-02-17 04:20 +0100
Re: [PATCH 2/7] drm/sun4i: Fix up error path cleanup for master bind function Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-21 21:30 +0100
csiph-web