From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B20B2C46460 for ; Thu, 30 May 2019 03:50:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80DBB24D58 for ; Thu, 30 May 2019 03:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559188207; bh=o4fi0g2p2e7kj7BIN5dxvkwBx3Nj9p6CmJ1glO/bds0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0FoVuJoqy2nxtFivebIOpmVfKwWFLnrwU25TLoDSEP1wNTfoRxbiV+LGm6wktCew4 DgOY+VXiM/03TzqAIOLGFo8mvQQYzWcuZl/JtFYFFmXZB/smT5lLN6A9BSvEpmkxNs qieQZBuTkb5iOFsT+mzeZ5dxIsnsUb5yYzsiGMyM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729661AbfE3DuG (ORCPT ); Wed, 29 May 2019 23:50:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732101AbfE3DUA (ORCPT ); Wed, 29 May 2019 23:20:00 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A58B24905; Thu, 30 May 2019 03:19:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186399; bh=o4fi0g2p2e7kj7BIN5dxvkwBx3Nj9p6CmJ1glO/bds0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ivo1Xa+AogLK4R0FKasqBUrUUQIizcsLYq4y4WVKuF5y05GYD55PX5Kcvwr149LrD pFizLxFgweRZDAL13EEm/n8Q5D5wbUY3SH3fWmGtegLtbGXVRbaQZB0qWNGIoeQ1Cz 2ZAMIqbl81KchvF2Yg8llAeeCsqBLuudCaiiMH6A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Laurent Pinchart , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 181/193] media: vimc: zero the media_device on probe Date: Wed, 29 May 2019 20:07:15 -0700 Message-Id: <20190530030512.748251914@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030446.953835040@linuxfoundation.org> References: <20190530030446.953835040@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit f74267b51cb36321f777807b2e04ca02167ecc08 ] The media_device is part of a static global vimc_device struct. The media framework expects this to be zeroed before it is used, however, since this is a global this is not the case if vimc is unbound and then bound again. So call memset to ensure any left-over values are cleared. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/vimc/vimc-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c index 51c0eee61ca67..57e5d6a020b0e 100644 --- a/drivers/media/platform/vimc/vimc-core.c +++ b/drivers/media/platform/vimc/vimc-core.c @@ -302,6 +302,8 @@ static int vimc_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "probe"); + memset(&vimc->mdev, 0, sizeof(vimc->mdev)); + /* Create platform_device for each entity in the topology*/ vimc->subdevs = devm_kcalloc(&vimc->pdev.dev, vimc->pipe_cfg->num_ents, sizeof(*vimc->subdevs), GFP_KERNEL); -- 2.20.1