Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

parisc: kernel: replace kfree() with put_device() in create_tree_node()

If device_register() fails, put_device() is the correct way to
drop the device reference.

Found by code review.

Fixes: 1070c9655b90 ("[PA-RISC] Fix must_check warnings in drivers.c")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Haoxiang Li and committed by
Helge Deller
dcf69599 8f0b4cce

+1 -1
+1 -1
arch/parisc/kernel/drivers.c
··· 435 435 dev->dev.dma_mask = &dev->dma_mask; 436 436 dev->dev.coherent_dma_mask = dev->dma_mask; 437 437 if (device_register(&dev->dev)) { 438 - kfree(dev); 438 + put_device(&dev->dev); 439 439 return NULL; 440 440 } 441 441