Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e534f3e9 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Greg Kroah-Hartman
Browse files

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: default avatarHimangi Saraogi <himangi774@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b77f2767
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -106,7 +106,7 @@ static int nvec_mouse_probe(struct platform_device *pdev)
	struct serio *ser_dev;
	struct serio *ser_dev;
	char mouse_reset[] = { NVEC_PS2, SEND_COMMAND, PSMOUSE_RST, 3 };
	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)
	if (ser_dev == NULL)
		return -ENOMEM;
		return -ENOMEM;