Commit eeafa64b authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

USB: atm/cxacru, fix lock imbalance

We do not hold mutex in one place in cxacru_cm, but unlock it on fail path.
Fix this.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Cc: Simon Arlott <cxacru@fire.lp0.eu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c497e715
...@@ -485,7 +485,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm, ...@@ -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", usb_err(instance->usbatm, "requested transfer size too large (%d, %d)\n",
wbuflen, rbuflen); wbuflen, rbuflen);
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto err;
} }
mutex_lock(&instance->cm_serialize); mutex_lock(&instance->cm_serialize);
...@@ -565,6 +565,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm, ...@@ -565,6 +565,7 @@ static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
dbg("cm %#x", cm); dbg("cm %#x", cm);
fail: fail:
mutex_unlock(&instance->cm_serialize); mutex_unlock(&instance->cm_serialize);
err:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment