mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
firewire: net: fix use after free
commit8987583366
upstream. Commit8408dc1c14
"firewire: net: use dev_printk API" introduced a use-after-free in a failure path. fwnet_transmit_packet_failed(ptask) may free ptask, then the dev_err() call dereferenced it. The fix is straightforward; simply reorder the two calls. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a299804140
commit
f37058b887
1 changed files with 3 additions and 3 deletions
|
@ -1014,8 +1014,6 @@ static void fwnet_write_complete(struct fw_card *card, int rcode,
|
|||
if (rcode == RCODE_COMPLETE) {
|
||||
fwnet_transmit_packet_done(ptask);
|
||||
} else {
|
||||
fwnet_transmit_packet_failed(ptask);
|
||||
|
||||
if (printk_timed_ratelimit(&j, 1000) || rcode != last_rcode) {
|
||||
dev_err(&ptask->dev->netdev->dev,
|
||||
"fwnet_write_complete failed: %x (skipped %d)\n",
|
||||
|
@ -1023,8 +1021,10 @@ static void fwnet_write_complete(struct fw_card *card, int rcode,
|
|||
|
||||
errors_skipped = 0;
|
||||
last_rcode = rcode;
|
||||
} else
|
||||
} else {
|
||||
errors_skipped++;
|
||||
}
|
||||
fwnet_transmit_packet_failed(ptask);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue