Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / arch / sparc / kernel / ldc.c
index 435e406..1beaf60 100644 (file)
@@ -1339,7 +1339,7 @@ int ldc_connect(struct ldc_channel *lp)
        if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) ||
            !(lp->flags & LDC_FLAG_REGISTERED_QUEUES) ||
            lp->hs_state != LDC_HS_OPEN)
-               err = -EINVAL;
+               err = ((lp->hs_state > LDC_HS_OPEN) ? 0 : -EINVAL);
        else
                err = start_handshake(lp);