From: K. Y. Srinivasan Date: Tue, 17 May 2011 22:25:38 +0000 (-0700) Subject: Connector: Correctly set the error code in case of success when dispatching receive... X-Git-Tag: v3.0-rc6~28^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=663dd6dcaf7e95526e469e91f41972a9c0cca30c;p=karo-tx-linux.git Connector: Correctly set the error code in case of success when dispatching receive callbacks The recent changes to the connector code introduced this bug where even when a callback was invoked, we would return an error resulting in double freeing of the skb. This patch fixes this bug. Signed-off-by: K. Y. Srinivasan Acked-by: Evgeniy Polyakov Cc: stable [.39] Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index 219d88a0eeae..dde6a0fad408 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c @@ -139,6 +139,7 @@ static int cn_call_callback(struct sk_buff *skb) spin_unlock_bh(&dev->cbdev->queue_lock); if (cbq != NULL) { + err = 0; cbq->callback(msg, nsp); kfree_skb(skb); cn_queue_release_callback(cbq);