Commit b9ecbfa
committed
nvme: apple: fix device reference counting
Drivers must call nvme_uninit_ctrl after a successful nvme_init_ctrl.
Split the allocation side out to make the error handling boundary easier
to navigate. The apple driver had been doing this wrong, leaking the
controller device memory on a tagset failure.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>1 parent 4434887 commit b9ecbfa
1 file changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | | - | |
| 1391 | + | |
1392 | 1392 | | |
1393 | 1393 | | |
1394 | 1394 | | |
1395 | 1395 | | |
1396 | 1396 | | |
1397 | 1397 | | |
1398 | 1398 | | |
1399 | | - | |
| 1399 | + | |
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
| |||
1516 | 1516 | | |
1517 | 1517 | | |
1518 | 1518 | | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
1519 | 1534 | | |
1520 | 1535 | | |
1521 | 1536 | | |
1522 | | - | |
| 1537 | + | |
| 1538 | + | |
1523 | 1539 | | |
1524 | 1540 | | |
1525 | 1541 | | |
1526 | 1542 | | |
1527 | 1543 | | |
1528 | 1544 | | |
1529 | 1545 | | |
1530 | | - | |
1531 | | - | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
1532 | 1549 | | |
1533 | 1550 | | |
1534 | 1551 | | |
| |||
0 commit comments