History

soundwire: bus: fix device number leak on errors

If the programming of the dev_number fails due to an IO error, a new device_number will be assigned, resulting in a leak. Make sure we only assign a device_number once per Slave device.

Pierre-Louis Bossart committed 6 years ago

Commit fd6a3ac1 parent 78f6fdd2 files · +26 −15Browse files

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

Unified · Split

include/linux/soundwire/sdw.h+3−1
@@ -546,7 +546,8 @@ struct sdw_slave_ops { · 545 unmodified lines
546 * @debugfs: Slave debugfs546 * @debugfs: Slave debugfs
547 * @node: node for bus list547 * @node: node for bus list
548 * @port_ready: Port ready completion flag for each Slave port548 * @port_ready: Port ready completion flag for each Slave port
549 * @dev_num: Device Number assigned by Bus549 * @dev_num: Current Device Number, values can be 0 or dev_num_sticky
550 * @dev_num_sticky: one-time static Device Number assigned by Bus
550 * @probed: boolean tracking driver state551 * @probed: boolean tracking driver state
551 * @probe_complete: completion utility to control potential races552 * @probe_complete: completion utility to control potential races
552 * on startup between driver probe/initialization and SoundWire553 * on startup between driver probe/initialization and SoundWire
@@ -575,6 +576,7 @@ struct sdw_slave { · 22 unmodified lines
575 struct list_head node;576 struct list_head node;
576 struct completion *port_ready;577 struct completion *port_ready;
577 u16 dev_num;578 u16 dev_num;
579 u16 dev_num_sticky;
578 bool probed;580 bool probed;
579 struct completion probe_complete;581 struct completion probe_complete;
580 struct completion enumeration_complete;582 struct completion enumeration_complete;

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