From patchwork Fri Jun 12 16:51:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Krakora X-Patchwork-Id: 29918 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5CGpKoM022567 for ; Fri, 12 Jun 2009 16:51:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751493AbZFLQvE (ORCPT ); Fri, 12 Jun 2009 12:51:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751545AbZFLQvE (ORCPT ); Fri, 12 Jun 2009 12:51:04 -0400 Received: from yw-out-2324.google.com ([74.125.46.29]:64060 "EHLO yw-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751493AbZFLQvB (ORCPT ); Fri, 12 Jun 2009 12:51:01 -0400 Received: by yw-out-2324.google.com with SMTP id 5so1550839ywb.1 for ; Fri, 12 Jun 2009 09:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ciRSeo803VRavJ/HTcbbWPxZm/5Uzxk0Dl99NM4629E=; b=QIdYVbv8SNk45nLX6nq5Si8d1bMuDkf83A48SN6zha52UPnlmBW8QnukghDHwyJQMA PIxDwaBUzEccN2Vr0tiomnjjj/JoJVtzuiWUWW8wi8THkIe6PjjUTX0yUSV/NxLHbXCj wzsevxpnq1jcbrd8cNYzJ4Iz/mN5haEy6qvqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=xeZJf5gxr3zdibAUinvi0hfbblxuVLsdsrDb4HDcd0Ng7ZBLOCdNYCL+yXTpW/uy04 9OPSxRNUtEJ+VfTD2Qz2d7svKfZJtT3ia+ICwEjk2lKrwgIZ5LH3FZbruWlq+tMFrFPV 8H9nninCCO6zBUdyFD0Q2YDODC6wBsEVdCdws= MIME-Version: 1.0 Received: by 10.150.189.2 with SMTP id m2mr7779710ybf.333.1244825463795; Fri, 12 Jun 2009 09:51:03 -0700 (PDT) Date: Fri, 12 Jun 2009 12:51:03 -0400 X-Google-Sender-Auth: 2d5b42821240ec97 Message-ID: Subject: [PATCH 1/2] uvc: Fix for no return value check of uvc_ctrl_set() which calls mutex_lock_interruptible() From: Robert Krakora To: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Robert Krakora Fix for no return value check of uvc_ctrl_set() which calls mutex_lock_interruptible(). Priority: normal Signed-off-by: Robert Krakora Acked-by: Laurent Pinchart --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r bff77ec33116 linux/drivers/media/video/uvc/uvc_v4l2.c --- a/linux/drivers/media/video/uvc/uvc_v4l2.c Thu Jun 11 18:44:23 2009 -0300 +++ b/linux/drivers/media/video/uvc/uvc_v4l2.c Fri Jun 12 11:35:04 2009 -0400 @@ -538,7 +538,10 @@ memset(&xctrl, 0, sizeof xctrl); xctrl.id = ctrl->id; - uvc_ctrl_begin(video); + ret = uvc_ctrl_begin(video); + if (ret < 0) + return ret; + ret = uvc_ctrl_get(video, &xctrl); uvc_ctrl_rollback(video); if (ret >= 0) @@ -555,7 +558,10 @@ xctrl.id = ctrl->id; xctrl.value = ctrl->value; - uvc_ctrl_begin(video); + ret = uvc_ctrl_begin(video); + if (ret < 0) + return ret; + ret = uvc_ctrl_set(video, &xctrl); if (ret < 0) { uvc_ctrl_rollback(video); @@ -574,7 +580,10 @@ struct v4l2_ext_control *ctrl = ctrls->controls; unsigned int i; - uvc_ctrl_begin(video); + ret = uvc_ctrl_begin(video); + if (ret < 0) + return ret; + for (i = 0; i < ctrls->count; ++ctrl, ++i) { ret = uvc_ctrl_get(video, ctrl); if (ret < 0) {