From patchwork Mon May 13 05:49:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2562871 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 0933CDF24C for ; Tue, 14 May 2013 05:41:59 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ublgr-0007h0-Iu; Mon, 13 May 2013 05:53:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ubldk-0004Kt-Hh; Mon, 13 May 2013 05:49:40 +0000 Received: from mail-bk0-x22c.google.com ([2a00:1450:4008:c01::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ubldf-0004KJ-TT for linux-arm-kernel@lists.infradead.org; Mon, 13 May 2013 05:49:38 +0000 Received: by mail-bk0-f44.google.com with SMTP id jk13so2211675bkc.17 for ; Sun, 12 May 2013 22:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=oxDNMGF2tFghkDk4+A2HjjzqTxgb7kGPQJFiL3TVU7w=; b=nR/j2TF77Goy8gNtq8CKEUKDCqMQdHnqkqoq8ig8AsbIGodqkeJqgIS/ehaOoF+OXv IAEvFFUixAD2SArZ3h5yBgnYZVSIMi6dVV35Vw9GBBE7W9eRZ29aOVQZPrPknoVg1DgK 62w1ecrnxojba6jg4NLST4B5gM45fqJMYinxzwJCHg8VHu5YG69U3F4H6vS95BHbmcOW 053RU4ZAP+CnsZa4VRmPvY4K1Y9qA23rauvUZPuGeETFvall9drdqV1QL7yh1VC81N7D +zl3duSn1t6iJRd4u9Jor6fJGAJi2XfDuKjBPMGw25oDCUGyYSjOeQZiBC6C3mTDW0uk 782A== MIME-Version: 1.0 X-Received: by 10.204.62.137 with SMTP id x9mr5133166bkh.90.1368424153893; Sun, 12 May 2013 22:49:13 -0700 (PDT) Received: by 10.204.199.129 with HTTP; Sun, 12 May 2013 22:49:13 -0700 (PDT) Date: Mon, 13 May 2013 13:49:13 +0800 Message-ID: Subject: [PATCH] [media] s5p-tv: fix error return code in mxr_acquire_video() From: Wei Yongjun To: kyungmin.park@samsung.com, t.stanislaws@samsung.com, mchehab@redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130513_014936_116302_DCC44F97 X-CRM114-Status: GOOD ( 10.60 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (weiyj.lk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: yongjun_wei@trendmicro.com.cn, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Wei Yongjun Fix to return a negative error code in the vb2_dma_contig_init_ctx() error handling case instead of 0, as done elsewhere in this function. Also vb2_dma_contig_init_ctx() return ERR_PTR() in case of error and never return NULL, so use IS_ERR() replace IS_ERR_OR_NULL(). Signed-off-by: Wei Yongjun --- drivers/media/platform/s5p-tv/mixer_video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c index ef0efdf..641b1f0 100644 --- a/drivers/media/platform/s5p-tv/mixer_video.c +++ b/drivers/media/platform/s5p-tv/mixer_video.c @@ -81,8 +81,9 @@ int mxr_acquire_video(struct mxr_device *mdev, } mdev->alloc_ctx = vb2_dma_contig_init_ctx(mdev->dev); - if (IS_ERR_OR_NULL(mdev->alloc_ctx)) { + if (IS_ERR(mdev->alloc_ctx)) { mxr_err(mdev, "could not acquire vb2 allocator\n"); + ret = PTR_ERR(mdev->alloc_ctx); goto fail_v4l2_dev; }