Skip to content

Commit e534f3e

Browse files
himangi774gregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b77f276 commit e534f3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/nvec/nvec_ps2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int nvec_mouse_probe(struct platform_device *pdev)
106106
struct serio *ser_dev;
107107
char mouse_reset[] = { NVEC_PS2, SEND_COMMAND, PSMOUSE_RST, 3 };
108108

109-
ser_dev = kzalloc(sizeof(struct serio), GFP_KERNEL);
109+
ser_dev = devm_kzalloc(&pdev->dev, sizeof(struct serio), GFP_KERNEL);
110110
if (ser_dev == NULL)
111111
return -ENOMEM;
112112

0 commit comments

Comments
 (0)