Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp579953img; Fri, 22 Mar 2019 04:27:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOCVz+RdFRK99Tf4EH7Up5j3sae3nd1QetdFyU9jrDKKgIji25V/Cb7RYA1cPBU4I5rYt7 X-Received: by 2002:a62:1c87:: with SMTP id c129mr8637657pfc.94.1553254075752; Fri, 22 Mar 2019 04:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553254075; cv=none; d=google.com; s=arc-20160816; b=E3W4L0aLDuPn1GxAAUC+p4sQCDA23BdVBFYiMtyajWYYfVoJHj7b3k2ji6NksIJrF4 /N8hBbmyQV9LK8T3e9+dZCpxlWOW/KON5PWAqd5IGbCcAqU0Cp/lmqh49DBSyKyjHjWt hCmO0KSobeLn5NU3aF4e7Ha70uCi8MmqJUO6v5tiLe8B9Xizecyg1b2ZPUM91V30RNkU QZt++qCfdZCL28tjXARhvTZqMyF2KV+NoSTpQMRz07z7VS0fE9ApUb5kKEE/qbBitxz2 Yvd6K/uFjl/oi3EHVjldl4oYfmj9YRlPagk11PewbOOZiuUKkCaFMPhPl8GJAHH3LoGA aTwg== 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=DUBHtdC9vcQErPBQYCyp9iqhQ85mB3W0qb7n01zF8iE=; b=OYrLRFe7mdXxiHvlfpnCrEY16C/YjTr8FugkcupPm4WsKcDrXGGYn++nR7uRgmHmQK U5wZphwpMTVhqh7wyOXBPjAZKnsemxOxulLXyk8Jn0XX9v8rTb7L5FbNJXdgEqwT7P41 yykwaWPRCY1DfwPtu/Yw6Zj9WXXPcYtAkleTJtUoH0UCeY+ObwrBfHHIgv93aYk2N0Yy wwcc2G7FwgUIuBosdoAxG2CJCflY1z0L3Uh5vXVOEc/+hAhE90WsZvXWCwTnnug7rAea idiybMjxO7Rjb7pPwYbyjiHNhyhlu3BOFvJn874s/5sEIqNMEuTsXmJvLLdfH3RKzGSk kMnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pgTzBGBG; 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 o86si2925100pfa.270.2019.03.22.04.27.37; Fri, 22 Mar 2019 04:27:55 -0700 (PDT) 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=pgTzBGBG; 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 S1729359AbfCVLZ4 (ORCPT + 99 others); Fri, 22 Mar 2019 07:25:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:53512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728732AbfCVLZz (ORCPT ); Fri, 22 Mar 2019 07:25:55 -0400 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 23CBF21916; Fri, 22 Mar 2019 11:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253954; bh=dVB8mm9g7TXmk6jyHWAgK5L53uSn/G/vQak8mKzg7kA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pgTzBGBGF+r07d4F53nKd2IBib3fWqdTMqEHwFLQPxq3bjpB10ZE87rYn5p7xxWdz QTpQhe8sBVuyN8D2mEdu3uPsG2/ZTWI3lzz2eAIp7CnASFP0lGOhlch+bQLwxW8AnG U1cPLzdkW/Fq+yLFqNQ82UEQYPXI+qzLXCiPLFUQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Cox , QiaoChong , Sudip Mukherjee Subject: [PATCH 3.18 122/134] parport_pc: fix find_superio io compare code, should use equal test. Date: Fri, 22 Mar 2019 12:15:35 +0100 Message-Id: <20190322111219.245634038@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: QiaoChong commit 21698fd57984cd28207d841dbdaa026d6061bceb upstream. In the original code before 181bf1e815a2 the loop was continuing until it finds the first matching superios[i].io and p->base. But after 181bf1e815a2 the logic changed and the loop now returns the pointer to the first mismatched array element which is then used in get_superio_dma() and get_superio_irq() and thus returning the wrong value. Fix the condition so that it now returns the correct pointer. Fixes: 181bf1e815a2 ("parport_pc: clean up the modified while loops using for") Cc: Alan Cox Cc: stable@vger.kernel.org Signed-off-by: QiaoChong [rewrite the commit message] Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman --- drivers/parport/parport_pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c @@ -1377,7 +1377,7 @@ static struct superio_struct *find_super { int i; for (i = 0; i < NR_SUPERIOS; i++) - if (superios[i].io != p->base) + if (superios[i].io == p->base) return &superios[i]; return NULL; }