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
546546 * @debugfs: Slave debugfs
547547 * @node: node for bus list
548548 * @port_ready: Port ready completion flag for each Slave port
549− * @dev_num: Device Number assigned by Bus
549+ * @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
550551 * @probed: boolean tracking driver state
551552 * @probe_complete: completion utility to control potential races
552553 * on startup between driver probe/initialization and SoundWire
@@ -575,6 +576,7 @@ struct sdw_slave { · 22 unmodified lines
575576 struct list_head node;
576577 struct completion *port_ready;
577578 u16 dev_num;
579+ u16 dev_num_sticky;
578580 bool probed;
579581 struct completion probe_complete;
580582 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