From patchwork Wed Feb 5 18:54:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sensoray-dev X-Patchwork-Id: 3588291 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F1348C02DC for ; Wed, 5 Feb 2014 18:55:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3042720158 for ; Wed, 5 Feb 2014 18:55:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D82B20149 for ; Wed, 5 Feb 2014 18:54:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753339AbaBESy5 (ORCPT ); Wed, 5 Feb 2014 13:54:57 -0500 Received: from gateway14.websitewelcome.com ([69.93.164.18]:34754 "EHLO gateway14.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbaBESy4 (ORCPT ); Wed, 5 Feb 2014 13:54:56 -0500 Received: by gateway14.websitewelcome.com (Postfix, from userid 5007) id BB09853264F29; Wed, 5 Feb 2014 12:54:55 -0600 (CST) Received: from gator3086.hostgator.com (ns6171.hostgator.com [50.87.144.121]) by gateway14.websitewelcome.com (Postfix) with ESMTP id 9C0FC53264EA0 for ; Wed, 5 Feb 2014 12:54:55 -0600 (CST) Received: from [50.43.67.108] (port=57842 helo=localhost.localdomain) by gator3086.hostgator.com with esmtpa (Exim 4.80) (envelope-from ) id 1WB7cc-0000WY-Ti; Wed, 05 Feb 2014 12:54:55 -0600 From: Dean Anderson To: hverkuil@xs4all.nl, linux-dev@sensoray.com, linux-media@vger.kernel.org Subject: [PATCH] s2255drv: fix for return code not checked Date: Wed, 5 Feb 2014 10:54:49 -0800 Message-Id: <1391626489-4441-1-git-send-email-linux-dev@sensoray.com> X-Mailer: git-send-email 1.7.9.5 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3086.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sensoray.com X-BWhitelist: no X-Source-IP: 50.43.67.108 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (localhost.localdomain) [50.43.67.108]:57842 X-Source-Auth: dean@sensoray.com X-Email-Count: 11 X-Source-Cap: c2Vuc29yYXk7c2Vuc29yYXk7Z2F0b3IzMDg2Lmhvc3RnYXRvci5jb20= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Start acquisition return code was not being checked. Return error if start acquisition fails. Signed-off-by: Dean Anderson --- drivers/media/usb/s2255/s2255drv.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 4c483ad..556e5e5 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -1230,12 +1230,16 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) vc->buffer.frame[j].cur_size = 0; } res = videobuf_streamon(&fh->vb_vidq); - if (res == 0) { - s2255_start_acquire(vc); - vc->b_acquire = 1; - } else + if (res != 0) { res_free(fh); - + return res; + } + res = s2255_start_acquire(vc); + if (res != 0) { + res_free(fh); + return res; + } + vc->b_acquire = 1; return res; }