Skip to content

Commit ced4913

Browse files
jhovoldmarckleinebudde
authored andcommitted
can: softing_cs: softingcs_probe(): fix memleak on registration failure
In case device registration fails during probe, the driver state and the embedded platform device structure needs to be freed using platform_device_put() to properly free all resources (e.g. the device name). Fixes: 0a0b7a5 ("can: add driver for Softing card") Link: https://lore.kernel.org/all/[email protected] Cc: [email protected] # 2.6.38 Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 6dc9a23 commit ced4913

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/can/softing/softing_cs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int softingcs_probe(struct pcmcia_device *pcmcia)
293293
return 0;
294294

295295
platform_failed:
296-
kfree(dev);
296+
platform_device_put(pdev);
297297
mem_failed:
298298
pcmcia_bad:
299299
pcmcia_failed:

0 commit comments

Comments
 (0)