Repository navigation
Commit 03c4271
can: mcp251x: fix resume from sleep before interface was brought up
Since 8ce8c0a the driver queues work via priv->restart_work when
resuming after suspend, even when the interface was not previously
enabled. This causes a null dereference error as the workqueue is only
allocated and initialized in mcp251x_open().
To fix this we move the workqueue init to mcp251x_can_probe() as there
is no reason to do it later and repeat it whenever mcp251x_open() is
called.
Fixes: 8ce8c0a ("can: mcp251x: only reset hardware as required")
Link: https://lore.kernel.org/r/17d5d714-b468-482f-f37a-482e3d6df84e@kontron.de
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
[mkl: fix error handling in mcp251x_stop()]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>1 parent 4376ea4 commit 03c4271
1 file changed
Lines changed: 18 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
956 | 956 | | |
957 | 957 | | |
958 | 958 | | |
959 | | - | |
960 | | - | |
961 | 959 | | |
962 | 960 | | |
963 | 961 | | |
| |||
1224 | 1222 | | |
1225 | 1223 | | |
1226 | 1224 | | |
1227 | | - | |
1228 | | - | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
1233 | | - | |
1234 | | - | |
1235 | | - | |
1236 | 1225 | | |
1237 | 1226 | | |
1238 | | - | |
| 1227 | + | |
1239 | 1228 | | |
1240 | 1229 | | |
1241 | | - | |
| 1230 | + | |
1242 | 1231 | | |
1243 | 1232 | | |
1244 | | - | |
| 1233 | + | |
1245 | 1234 | | |
1246 | 1235 | | |
1247 | 1236 | | |
| |||
1250 | 1239 | | |
1251 | 1240 | | |
1252 | 1241 | | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
| 1242 | + | |
1256 | 1243 | | |
1257 | 1244 | | |
1258 | 1245 | | |
| |||
1373 | 1360 | | |
1374 | 1361 | | |
1375 | 1362 | | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1376 | 1372 | | |
1377 | 1373 | | |
1378 | 1374 | | |
| |||
1417 | 1413 | | |
1418 | 1414 | | |
1419 | 1415 | | |
| 1416 | + | |
| 1417 | + | |
1420 | 1418 | | |
1421 | 1419 | | |
1422 | 1420 | | |
| |||
1438 | 1436 | | |
1439 | 1437 | | |
1440 | 1438 | | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
1441 | 1442 | | |
1442 | 1443 | | |
1443 | 1444 | | |
| |||
0 commit comments