Commit 9a0afdd
soundwire: stream: sdw_stream_remove_slave(): Check stream is valid
In sdw_stream_remove_slave() check that stream is a valid pointer
before passing it to functions that dereference it. Return 0 if the
pointer is invalid.
This is a convenience for callers. They can safely call this function
during cleanup code without needing a pointer validity check duplicated
at every call point.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20260430143353.2702714-1-rf@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>1 parent 254f496 commit 9a0afdd
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2229 | 2229 | | |
2230 | 2230 | | |
2231 | 2231 | | |
2232 | | - | |
| 2232 | + | |
| 2233 | + | |
2233 | 2234 | | |
2234 | 2235 | | |
2235 | 2236 | | |
2236 | 2237 | | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
2237 | 2241 | | |
2238 | 2242 | | |
2239 | 2243 | | |
| |||
0 commit comments