History

spi: fix resource leaks on device setup failure

Johan Hovold <johan@kernel.org> says: Make sure to call controller cleanup() if spi_setup() fails while registering a device to avoid leaking any resources allocated by setup().

Mark Brown committed 6 months ago

Commit 16ab65d2 parents ad50f7b a6e23842 files · +38 −25Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/spi/spi.h+1−1
@@ -701,7 +701,7 @@ struct spi_controller { · 700 unmodified lines
701 int (*transfer)(struct spi_device *spi,701 int (*transfer)(struct spi_device *spi,
702 struct spi_message *mesg);702 struct spi_message *mesg);
703 703
704 /* Called on release() to free memory provided by spi_controller */704 /* Called on deregistration to free memory provided by spi_controller */
705 void (*cleanup)(struct spi_device *spi);705 void (*cleanup)(struct spi_device *spi);
706 706
707 /*707 /*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t