mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
ata: fixes kernel crash while tracing ata_eh_link_autopsy event
commitf1601113ddupstream. When tracing ata link error event, the kernel crashes when the disk is removed due to NULL pointer access by trace_ata_eh_link_autopsy API. This occurs as the dev is NULL when the disk disappeared. This patch fixes this crash by calling trace_ata_eh_link_autopsy only if "dev" is not NULL. v2 changes: Removed direct passing "link" pointer instead of "dev" in trace API. Signed-off-by: Rameshwar Prasad Sahu <rsahu@apm.com> Signed-off-by: Tejun Heo <tj@kernel.org> Fixes:255c03d15a("libata: Add tracepoints") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f1be210210
commit
189bc68954
|
|
@ -2245,8 +2245,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
|
|||
if (dev->flags & ATA_DFLAG_DUBIOUS_XFER)
|
||||
eflags |= ATA_EFLAG_DUBIOUS_XFER;
|
||||
ehc->i.action |= ata_eh_speed_down(dev, eflags, all_err_mask);
|
||||
trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask);
|
||||
}
|
||||
trace_ata_eh_link_autopsy(dev, ehc->i.action, all_err_mask);
|
||||
DPRINTK("EXIT\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user