On 16/02/16 16:18, Jyri Sarha wrote: > Allocate suspend/resume register storage based on the actual number > registers the driver is aware of. The static allocation for register > storage had falen behind badly. "fallen" > > Reported-by: Michael Bode <michael@xxxxxxxxxx> > Signed-off-by: Jyri Sarha <jsarha@xxxxxx> > --- > drivers/gpu/drm/tilcdc/tilcdc_drv.c | 21 ++++++++++++++++++++- > drivers/gpu/drm/tilcdc/tilcdc_drv.h | 2 +- > 2 files changed, 21 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > index 893ef18..ab1789b 100644 > --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c > +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c > @@ -141,11 +141,14 @@ static int tilcdc_unload(struct drm_device *dev) > > pm_runtime_disable(dev->dev); > > + kfree(priv->saved_register); > kfree(priv); > > return 0; > } > > +static size_t tilcdc_num_regs(void); > + > static int tilcdc_load(struct drm_device *dev, unsigned long flags) > { > struct platform_device *pdev = dev->platformdev; > @@ -157,7 +160,12 @@ static int tilcdc_load(struct drm_device *dev, unsigned long flags) > int ret; > > priv = kzalloc(sizeof(*priv), GFP_KERNEL); > - if (!priv) { > + if (priv) > + priv->saved_register = kcalloc(tilcdc_num_regs(), > + sizeof(*priv->saved_register), > + GFP_KERNEL); devm_kzalloc() would clean this up a bit. For both 'priv' and 'saved_registers'. Tomi
Attachment:
signature.asc
Description: OpenPGP digital signature
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel