From: Stefan Richter Date: Thu, 22 Jul 2010 09:58:05 +0000 (+0200) Subject: tools/firewire: nosy-dump: work around segfault in decode_fcp X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a8461c0f3bfffe752fc62ce3960eb827463e90b5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git tools/firewire: nosy-dump: work around segfault in decode_fcp If I run "nosy-dump --view=transaction" with my camcorder on battery instead of mains, it segfaults very quickly because of !t->request. Perhaps this is because of increased likelyhood of incomplete transactions (ack_busy when host writes to camcorder's FCP_Request) and a bug deeper in nosy-dump's transaction housekeeping. This is a quick workaround to get me going. Signed-off-by: Stefan Richter --- diff --git a/tools/firewire/nosy-dump.c b/tools/firewire/nosy-dump.c index 0bad0a42d772..1d4dd5439d43 100644 --- a/tools/firewire/nosy-dump.c +++ b/tools/firewire/nosy-dump.c @@ -230,6 +230,11 @@ handle_transaction(struct link_transaction *t) struct subaction *sa; int i; + if (!t->request) { + printf("BUG in handle_transaction\n"); + return; + } + for (i = 0; i < array_length(protocol_decoders); i++) if (protocol_decoders[i].decode(t)) break;