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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 61D51C33CAF for ; Thu, 16 Jan 2020 23:25:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 31E652072B for ; Thu, 16 Jan 2020 23:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217114; bh=rnofVM1r06/zCpQPxV0g+/0PybA7btznnK8eSOOv9tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1DZSDTi+lGTTq0XoaddKgKxcYVz28mg8oW7ugkMcn4dhbAnvSn7ZPmBHwRsRGwWkn OuUSUA9LYmPmvxQihdCNRjdz+/qUpUfEsMWwr83nTOKmDS02+z8L89cbB7JQVGUMSn GI9cbdZkmWtqiMk/ScYc1xWlNIYdq0aQ8cbWZJ/g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387738AbgAPXZM (ORCPT ); Thu, 16 Jan 2020 18:25:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:54674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729799AbgAPXZK (ORCPT ); Thu, 16 Jan 2020 18:25:10 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 058952072B; Thu, 16 Jan 2020 23:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217110; bh=rnofVM1r06/zCpQPxV0g+/0PybA7btznnK8eSOOv9tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aH4ohOvG6tFTMbureJMIBryRoSRIt9dRjv84/DoSww3hSX81+oQK/qIqik3JyVKAC 3RsqmyUshxESrLWlhR86/QayMRZsnULS0ojOf3NpRXDjTttmpHIGE8WJGhe1n6VDu9 P3Lhj/uAYenY0y2Oe+kE0jqMFCNkv+W0EHquOWW4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 5.4 152/203] media: v4l: cadence: Fix how unsued lanes are handled in csi2rx_start() Date: Fri, 17 Jan 2020 00:17:49 +0100 Message-Id: <20200116231758.150381634@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@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 From: Christophe JAILLET commit 2eca8e4c1df4864b937752c3aa2f7925114f4806 upstream. The 2nd parameter of 'find_first_zero_bit()' is a number of bits, not of bytes. So use 'csi2rx->max_lanes' instead of 'sizeof(lanes_used)'. Fixes: 1fc3b37f34f6 ("media: v4l: cadence: Add Cadence MIPI-CSI2 RX driver") Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/platform/cadence/cdns-csi2rx.c +++ b/drivers/media/platform/cadence/cdns-csi2rx.c @@ -129,7 +129,7 @@ static int csi2rx_start(struct csi2rx_pr */ for (i = csi2rx->num_lanes; i < csi2rx->max_lanes; i++) { unsigned int idx = find_first_zero_bit(&lanes_used, - sizeof(lanes_used)); + csi2rx->max_lanes); set_bit(idx, &lanes_used); reg |= CSI2RX_STATIC_CFG_DLANE_MAP(i, i + 1); }