caif-hsi: Bugfix - Piggyback'ed embedded CAIF frame lost
authorPer Ellefsen <Per.Ellefsen@stericsson.com>
Sun, 24 Jun 2012 11:01:37 +0000 (11:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Jun 2012 23:07:22 +0000 (16:07 -0700)
When receiving a piggyback'ed descriptor containing an
embedded frame, but no payload, the embedded frame was
lost.

Signed-off-by: Per Ellefsen <per.ellefsen@stericsson.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/caif/caif_hsi.c

index 1520814c77c7d1a4a94b0569069abb66cb356b51..1f52ff3076b41a81196baea30366c2718a7eae23 100644 (file)
@@ -693,8 +693,6 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
                         */
                        memcpy(rx_buf, (u8 *)piggy_desc,
                                        CFHSI_DESC_SHORT_SZ);
-                       /* Mark no embedded frame here */
-                       piggy_desc->offset = 0;
                        if (desc_pld_len == -EPROTO)
                                goto out_of_sync;
                }
@@ -737,6 +735,8 @@ static void cfhsi_rx_done(struct cfhsi *cfhsi)
                        /* Extract any payload in piggyback descriptor. */
                        if (cfhsi_rx_desc(piggy_desc, cfhsi) < 0)
                                goto out_of_sync;
+                       /* Mark no embedded frame after extracting it */
+                       piggy_desc->offset = 0;
                }
        }