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: 2627831 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 CB6F23FC23 for ; Wed, 29 May 2013 04:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751781Ab3E2EX7 (ORCPT ); Wed, 29 May 2013 00:23:59 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35783 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909Ab3E2EX7 (ORCPT ); Wed, 29 May 2013 00:23:59 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb11so7323075pad.23 for ; Tue, 28 May 2013 21:23:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=nWRuwCmVfrKgqKgJz/uA/JPyGEkIVdpK74ybGxbtbkg=; b=iS2P1yVcgHHg9jWvwWd8429DvS+WgygQKl0jrzD9dv2/NnEs1KZT8NuCaLtMkQPFVQ Rq7pB8sbxL+zfrg3Ul5HKDyk8PPKcAn9npVITyGAKt6lP/ACnsyq/EvJBwbDs7Yb4qPK 1AwHNCZhiCE8zJOlblrB7hBypml6doujRkaHn81Cv6gbduoIa2yMCVoJhp6ZOruA6ZzY cXCFUtnOLAP99kIFTwZ0pusTO3gkFdOrTmGlSC9ldtDXSV0arjqKHUDhY4o9V1OI6E+s 1ij76DXZqOF84o9mRSjHbKQDjGtzsAyuc6rMb9FUUAD4e0O8rYagyHkDoUv7Y6jXj5Ln Twcg== 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: ALoCoQkM3PH4Hf7u6HV483F/1+1851DwwNDSco1Jt+s+lzVPqz1lSNLv++Lqrhc717UcXB0IDY3u Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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;