Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3033094pxb; Mon, 18 Oct 2021 07:00:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9x21ZVkNeqg7zu0dHDWyf8iBBF20GvrxFz9bsdbxHFK/glMZbLDVrPVtueKmA3vKsrHX6 X-Received: by 2002:a17:903:10c:b0:13f:8bb0:8fbb with SMTP id y12-20020a170903010c00b0013f8bb08fbbmr22077187plc.51.1634565648554; Mon, 18 Oct 2021 07:00:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565648; cv=none; d=google.com; s=arc-20160816; b=Sci/Va1qSAc9DTM1NZMAXGLzq8gGqB27Oa/5otdCmGImvI4CiGP86GJInYDNCNBADG MBr0nkWPK3V9lPWgewuwKnxyxoC8yQpIjF9/Sl9IikF/G/IUaCUix62NjHELZBlSmBxU /dT0uYkjA8BuxhFFsDdZ6Ca5m3e/sfHk0wwO3hDNsbqBEPhd6HzhtV0ccatTxnH6pPeu 99OL6c1ArrkJk/74DStwqcfUr0wyafS8fgP/zMorwzP4we4DCWtgjonEE3heSz8Y9wHv ahu/ysp1OnFyasDbxAVCndrjXg1zAer/S658zy/c4Njayjk5Ybck261yevkTvkNksS8U OYVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/ozMf4uBcGl1LuCuitNL0i+pwrkGRY8lElHQmBey+kI=; b=j+T5R6EUeeOiT6QN7ta1PL/f9Yc6caJRIq10Vqp86NsB+z+maILiAusMr3PTN1RnnZ yzUQ2j/C0z69iFfJUdhYhsF/nybqnfUEPaEu3biB4ZsIgcppTB8AlKPG1+WC9xcftKDC I2BUsoxI4uQv6G3QAyGwNMk1ZcfE7ydWEr2snHozHS/iLpG3UjU+cWrUufs6CCc9Aj/1 eMVDosMpX/QKKLBXKlwupfvVYmWy7N3mqbLY/9d4sSNPC6jFVjwDY5r4B0cz4a4U2SM6 tg0UUXB2gwreOj4gYTql4VUNy+1pqEauE8TO0NuiFY0VIXmffQRmt+bSwnjgHGoqEBTh uGBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r7DtRQY7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k190si973975pgd.33.2021.10.18.07.00.34; Mon, 18 Oct 2021 07:00:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=r7DtRQY7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233332AbhJROBn (ORCPT + 99 others); Mon, 18 Oct 2021 10:01:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:40650 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233603AbhJRN7u (ORCPT ); Mon, 18 Oct 2021 09:59:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F7BE61504; Mon, 18 Oct 2021 13:41:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564512; bh=GtUFtZPhUjc5eDNtJlL6qcLEbY1v/WwfAhlBtYo5rrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r7DtRQY78dEX0RP59vpGeBhtQoJUAcL9U0lA/SUFCEo6ME8sZu7W9ZpRQn58aDFcS Uwy8iRehF5m7PzooQk+zSEuFqYvZnKfY5NhjfoYi8oVfK3KsgfS0298Obd/RreCmOB uHsgqr1LCsCi7J0nGK7OQ2rcEx9KHjNnMz0/qZkA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Damien Le Moal Subject: [PATCH 5.14 118/151] pata_legacy: fix a couple uninitialized variable bugs Date: Mon, 18 Oct 2021 15:24:57 +0200 Message-Id: <20211018132344.509224535@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit 013923477cb311293df9079332cf8b806ed0e6f2 upstream. The last byte of "pad" is used without being initialized. Fixes: 55dba3120fbc ("libata: update ->data_xfer hook for ATAPI") Signed-off-by: Dan Carpenter Signed-off-by: Damien Le Moal Signed-off-by: Greg Kroah-Hartman --- drivers/ata/pata_legacy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c @@ -352,7 +352,8 @@ static unsigned int pdc_data_xfer_vlb(st iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); if (unlikely(slop)) { - __le32 pad; + __le32 pad = 0; + if (rw == READ) { pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr)); memcpy(buf + buflen - slop, &pad, slop); @@ -742,7 +743,8 @@ static unsigned int vlb32_data_xfer(stru ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); if (unlikely(slop)) { - __le32 pad; + __le32 pad = 0; + if (rw == WRITE) { memcpy(&pad, buf + buflen - slop, slop); iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);