Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8506064ybl; Thu, 16 Jan 2020 18:19:37 -0800 (PST) X-Google-Smtp-Source: APXvYqzyhFpMNed/s3jq7A6S8HUd/WfGuDQo+l9fI3sNkI4Yhp9uZbfdp+q22Qo1bL/T3FByz0cY X-Received: by 2002:a9d:6b17:: with SMTP id g23mr4428021otp.265.1579227576936; Thu, 16 Jan 2020 18:19:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579227576; cv=none; d=google.com; s=arc-20160816; b=Ys7eT68tPMPsXVQAuZSl9hjbyS+qL7kSo9yyMvwcX9PqRSGM55FcFlTUwsRM8x3LxO SEWa3SjtJjiDoQoqF286xSuP15KINscra/psUPqIAs4J/UZfjf8/AMUULpMvu9dq/WmX j4zg12kTS4av2bd5ARubxx9HBjfs9rXhKLUVS9S4SbBerLdqXzRVwdRwCRdIXj3ipicZ LdBDO6meb/+xZ4cypX+i4qzepvH/errhZINSfucJNRQttWP115iiLfXPrtLrB0V8Ex6z /mlVB2K2b+0AYJil5pvVCQHWs16B1UxlbOW1GFCB3222AL3tkAppHI+qg8KxscQShHKb zQ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3M4RBMHvKWzFq7BJ8hBWeUc7jlQoLc6aCSHcWliCuqg=; b=T8nFvsJlbP3v0P9NdKeWdjiSImr5wyQDU3vkv+dY6JUU++jQ9vw7AlozGLl4VtIQOV itQoPBwxiXpfkF/fEvvETlT5kmNuQQdy37hUtjw8aBD0NRTjZTkTrMfgL9PWGKpHUG98 wVqRikaAy/0fRJ+s996Ow9kEAYFzpN8GR4oVJJCRbj1muuH+xZiGpjBSLrxcVDexjhzU UNlqy9jYxIamEZyGVZG+c7zPIhFc2bFuf8mquRcfRgj5R2Q6WtEmsAAfmuLVUsbPvwDK QM3dxVMGfNIUNmDViz4T5JTvaMYU3e/Xyi0K3mBFMeb/6nT8WXLG6Kw5BsrD0wclsVxb XFcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aH4ohOvG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h125si12259737oia.253.2020.01.16.18.19.24; Thu, 16 Jan 2020 18:19:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aH4ohOvG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388148AbgAPXZU (ORCPT + 99 others); Thu, 16 Jan 2020 18:25:20 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); }