From patchwork Mon Nov 27 13:12:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Shields X-Patchwork-Id: 10076873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2662D60353 for ; Mon, 27 Nov 2017 13:12:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14AF328E29 for ; Mon, 27 Nov 2017 13:12:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 098D928E2A; Mon, 27 Nov 2017 13:12:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA2F028E2F for ; Mon, 27 Nov 2017 13:12:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbdK0NMw (ORCPT ); Mon, 27 Nov 2017 08:12:52 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36570 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752282AbdK0NMv (ORCPT ); Mon, 27 Nov 2017 08:12:51 -0500 Received: by mail-pg0-f68.google.com with SMTP id 199so7028433pgg.3; Mon, 27 Nov 2017 05:12:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=KzsWnCzFCg60cBYZHCbaEtc0X2cG/zZEftauNEkmDPg=; b=M3QqKQBUlR2edjrkePIBmqwSOZonw0PgnqMwZPnqtwUnWTN6T+5lBkFxTZOVPmxI0Y oenprK3u1mANuMMgnpc6wQCW8wajZOjsDdEEj3mW8BPTY173nz6//p6Pko4hPoWumb37 Mg5qeGR25+Z0QIayry9x1bbXFPKX3NTUafD+Iy05ftlGAat274BcSZu4JnQ6ei49yu/L QcW3qdE9mc1CJykGJBFvSQixySvy9ssrGeVt/3wiUfWava6Vn+aN0PlhyhUVuwCq9QQR cX6rVzCB8Gp+c85CmU2PZzE511p+CLB0MZW/M3aiWUT2SMq9T76nCn1TbY9Hpjmpo6IF xdUw== X-Gm-Message-State: AJaThX76dvT09GeRVtjPvzD9SyWiTSYiVmBNVPynAS/jAxNwf/sp1IKd Iybx6xk9hC/Jwb7oJ5ouHcIaQoBm X-Google-Smtp-Source: AGs4zMb4roO9gsDAMYuYwv50Ltig4710UAYqZXIOyw+hmWjhWdFgZZ9L4/HPLQfpu9HHZmVC4wYLpg== X-Received: by 10.101.101.151 with SMTP id u23mr27841482pgv.74.1511788370278; Mon, 27 Nov 2017 05:12:50 -0800 (PST) Received: from lineageos.org (27-32-42-49.static.tpgi.com.au. [27.32.42.49]) by smtp.gmail.com with ESMTPSA id q83sm16158862pfk.68.2017.11.27.05.12.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Nov 2017 05:12:48 -0800 (PST) Date: Tue, 28 Nov 2017 00:12:41 +1100 From: Simon Shields To: linux-media@vger.kernel.org Cc: Krzysztof Kozlowski , Kukjin Kim , Mauro Carvalho Chehab , linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH] media: exynos4-is: check pipe is valid before calling subdev Message-ID: <20171127131241.GA32492@lineageos.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP if the subdev is not yet present (probably because the subdev module has not yet been loaded), the pipe will be NULL. Make sure that this is not the case before attempting to call the op. Signed-off-by: Simon Shields --- include/media/drv-intf/exynos-fimc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/media/drv-intf/exynos-fimc.h b/include/media/drv-intf/exynos-fimc.h index 69bcd2a07d5c..f9c64338841f 100644 --- a/include/media/drv-intf/exynos-fimc.h +++ b/include/media/drv-intf/exynos-fimc.h @@ -155,7 +155,8 @@ static inline struct exynos_video_entity *vdev_to_exynos_video_entity( } #define fimc_pipeline_call(ent, op, args...) \ - (!(ent) ? -ENOENT : (((ent)->pipe->ops && (ent)->pipe->ops->op) ? \ + ((!(ent) || !(ent)->pipe) ? -ENOENT : \ + (((ent)->pipe->ops && (ent)->pipe->ops->op) ? \ (ent)->pipe->ops->op(((ent)->pipe), ##args) : -ENOIOCTLCMD)) \ #endif /* S5P_FIMC_H_ */