From patchwork Tue Sep 4 16:14:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1403251 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5355D3FC71 for ; Tue, 4 Sep 2012 16:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757396Ab2IDQOx (ORCPT ); Tue, 4 Sep 2012 12:14:53 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:52034 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757280Ab2IDQOv (ORCPT ); Tue, 4 Sep 2012 12:14:51 -0400 Received: by wgbdr13 with SMTP id dr13so5825739wgb.1 for ; Tue, 04 Sep 2012 09:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=DtaQ4xY2j3u6vg8+nIiKGiN6vAKlerfxVvQasPW/Tuk=; b=mIVYEp3mzJavc9xQJ4on8rFbUnsXLAGgvcCHsGUmIYgM7gFZSkJmE0yVfWfSrnWPaP ulOWUKS0qIYu/6GkaavPQyzXDoGjpkAOa0I9x3P4eqhPicI/r9zTFGt+VsRjMQMyRyZr K57csXV9WlsYUen0Zo3hM3+udyWD+6lLdHsIzDbqaWYaJ5Qv4JbwNa5ACKFZeR8H6RKo K3+H+7Sz/GxCgH2A/e9LHEwhXss3WEGDlgthR6EftRSUXvL/av7CspAmky1Fjt+IfX7l 6GJG1yHVFkga3kbSHdxHoPqDWS1WiHZlggSqYZCugz2J8xIUYv6Avm+BElUZD6itvZCA n1vw== Received: by 10.216.29.10 with SMTP id h10mr11934127wea.126.1346775290339; Tue, 04 Sep 2012 09:14:50 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id l6sm24969613wiz.4.2012.09.04.09.14.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 09:14:49 -0700 (PDT) From: Peter Senna Tschudin To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] drivers/media/platform/vino.c: fix error return code Date: Tue, 4 Sep 2012 18:14:26 +0200 Message-Id: <1346775269-12191-2-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Peter Senna Tschudin Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Peter Senna Tschudin --- drivers/media/platform/vino.c | 1 + 1 file changed, 1 insertion(+) -- 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 --git a/drivers/media/platform/vino.c b/drivers/media/platform/vino.c index cc9110c..6654a28 100644 --- a/drivers/media/platform/vino.c +++ b/drivers/media/platform/vino.c @@ -2061,6 +2061,7 @@ static int vino_capture_next(struct vino_channel_settings *vcs, int start) } if (incoming == 0) { dprintk("vino_capture_next(): no buffers available\n"); + err = -ENOMEM; goto out; }