firewire: fw-sbp2: fix parsing of logical unit directories
authorRichard Sharpe <realrichardsharpe@gmail.com>
Wed, 25 Jun 2008 02:11:13 +0000 (19:11 -0700)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Fri, 27 Jun 2008 18:55:00 +0000 (20:55 +0200)
There is a small off-by-one bug in firewire-sbp2. This causes problems
when a device exports multiple LUN Directories. I found it when trying
to talk to a SONY DVD Jukebox.

Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com>
Acked-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (op. order, changelog)
drivers/firewire/fw-sbp2.c

index b2458bb8e9cade2fd79fea620b60eb9edd0aa7e0..227d2e036cd812f4e259fd13413298a818d16d6f 100644 (file)
@@ -1051,7 +1051,8 @@ static int sbp2_scan_unit_dir(struct sbp2_target *tgt, u32 *directory,
                        break;
 
                case SBP2_CSR_LOGICAL_UNIT_DIRECTORY:
-                       if (sbp2_scan_logical_unit_dir(tgt, ci.p + value) < 0)
+                       /* Adjust for the increment in the iterator */
+                       if (sbp2_scan_logical_unit_dir(tgt, ci.p - 1 + value) < 0)
                                return -ENOMEM;
                        break;
                }