aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/nvec
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2014-03-07 21:39:27 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-07 15:19:36 -0800
commite534f3e9429feb99ea133dfd5618b0dfc5af8a00 (patch)
tree228fb0379972da1e792e35c0f31ea5800346c017 /drivers/staging/nvec
parentStaging:nvec: fix quoted string split across lines (diff)
downloadlinux-dev-e534f3e9429feb99ea133dfd5618b0dfc5af8a00.tar.xz
linux-dev-e534f3e9429feb99ea133dfd5618b0dfc5af8a00.zip
staging:nvec: Introduce the use of the managed version of kzalloc
This patch moves shared private data kzalloc to managed devm_kzalloc. There are no kfree statements associated with this data, so using devm adds the possibility of the data being freed, if the proble function fails (if that is possible) or if the remove function succeeds. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/nvec')
-rw-r--r--drivers/staging/nvec/nvec_ps2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
index 06dbb02085a9..45b2f1308e01 100644
--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -106,7 +106,7 @@ static int nvec_mouse_probe(struct platform_device *pdev)
struct serio *ser_dev;
char mouse_reset[] = { NVEC_PS2, SEND_COMMAND, PSMOUSE_RST, 3 };
- ser_dev = kzalloc(sizeof(struct serio), GFP_KERNEL);
+ ser_dev = devm_kzalloc(&pdev->dev, sizeof(struct serio), GFP_KERNEL);
if (ser_dev == NULL)
return -ENOMEM;