Skip to content

Commit

Permalink
USB: atm/cxacru, fix lock imbalance
Browse files Browse the repository at this point in the history
We do not hold mutex in one place in cxacru_cm, but unlock it on fail path.
Fix this.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Simon Arlott <cxacru@fire.lp0.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Mar 17, 2009
1 parent c497e71 commit eeafa64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/atm/cxacru.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
usb_err(instance->usbatm, "requested transfer size too large (%d, %d)\n",
wbuflen, rbuflen);
ret = -ENOMEM;
goto fail;
goto err;
}

mutex_lock(&instance->cm_serialize);
Expand Down Expand Up @@ -565,6 +565,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
dbg("cm %#x", cm);
fail:
mutex_unlock(&instance->cm_serialize);
err:
return ret;
}

Expand Down

0 comments on commit eeafa64

Please sign in to comment.