From patchwork Wed May 29 04:10:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 17254 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EF2CD25E45 for ; Wed, 29 May 2013 04:24:02 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id p58sf6617726wes.10 for ; Tue, 28 May 2013 21:24:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=nWRuwCmVfrKgqKgJz/uA/JPyGEkIVdpK74ybGxbtbkg=; b=WgVx+YRK46tcq3pk0lHnEF8VXQyEBNM9Y08ZVAIypYltAV65hjTg57X3syQ6+ECJ9q rCtW0CnCJAFrl4Q248ovseVPJnd/fE+sh/z1waZF6b0nKql0CbNaB8TmE7Odi3j/2gMc vgaLkmDycFfb0Hh13vWNKqgrafiO5TNPTmppKASEQT0YmVBKtRY6RGNPKxUA5+lce2wR 88o9Xu3Bk1skVgJqVGxK7X17HMhrH3eJ7QntuI/5y/aVGXQgpox+InFC5E+odaD9QCHt mza8ygvSHYfES4CS5/1ZrYwjsNS8rBCVizeOn4kKDcQ3JyRSQfhwD+cLiKvXnOxl1Kxl CbmQ== X-Received: by 10.180.11.232 with SMTP id t8mr180226wib.3.1369801441528; Tue, 28 May 2013 21:24:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.76.71 with SMTP id i7ls1168623wiw.34.gmail; Tue, 28 May 2013 21:24:01 -0700 (PDT) X-Received: by 10.180.99.232 with SMTP id et8mr14546394wib.17.1369801441446; Tue, 28 May 2013 21:24:01 -0700 (PDT) Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com [2607:f8b0:400c:c01::231]) by mx.google.com with ESMTPS id yz1si5879828wjc.96.2013.05.28.21.24.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 May 2013 21:24:01 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::231; Received: by mail-ve0-f177.google.com with SMTP id cz10so1834397veb.22 for ; Tue, 28 May 2013 21:24:00 -0700 (PDT) X-Received: by 10.52.34.114 with SMTP id y18mr444199vdi.56.1369801440351; Tue, 28 May 2013 21:24:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp68042vcb; Tue, 28 May 2013 21:23:59 -0700 (PDT) X-Received: by 10.66.251.101 with SMTP id zj5mr1518622pac.122.1369801439044; Tue, 28 May 2013 21:23:59 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx.google.com with ESMTPS id vw1si25441380pab.226.2013.05.28.21.23.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 May 2013 21:23:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kl13so2568871pab.6 for ; Tue, 28 May 2013 21:23:58 -0700 (PDT) X-Received: by 10.68.189.105 with SMTP id gh9mr1011345pbc.77.1369801438479; Tue, 28 May 2013 21:23:58 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id b7sm35585613pba.39.2013.05.28.21.23.55 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 May 2013 21:23:57 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: k.debski@samsung.com, sylvester.nawrocki@gmail.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] [media] s5p-mfc: Add NULL check for allocated buffer Date: Wed, 29 May 2013 09:40:00 +0530 Message-Id: <1369800600-19929-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkfYD+p4YCGMJdcMOpnmD8HI3Fo/KxaBXB7XvCZqsIrRzL+wUDyXd44pWsMQAVbxQBDNx/Z X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In certain cases, dma_alloc_coherent returns NULL. Add check for NULL pointer. Signed-off-by: Sachin Kamat --- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index 2e5f30b..dc1fc94 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -38,7 +38,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) dev->fw_virt_addr = dma_alloc_coherent(dev->mem_dev_l, dev->fw_size, &dev->bank1, GFP_KERNEL); - if (IS_ERR(dev->fw_virt_addr)) { + if (IS_ERR_OR_NULL(dev->fw_virt_addr)) { dev->fw_virt_addr = NULL; mfc_err("Allocating bitprocessor buffer failed\n"); return -ENOMEM;