Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3009786pxb; Mon, 18 Oct 2021 06:32:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLowFZ/yses8A5IzrXpyaWpYJinI7Y2bTp/Bf5i9MHL+9avbavDPZUb2CElVkj3tZ4qlJS X-Received: by 2002:a17:902:8b81:b0:13f:3d30:f624 with SMTP id ay1-20020a1709028b8100b0013f3d30f624mr27228306plb.51.1634563948072; Mon, 18 Oct 2021 06:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634563948; cv=none; d=google.com; s=arc-20160816; b=oFzhlsmLcQbaO+K8pUOkRCP1miZTv8x3aKR4y9s7QRdpkmUwvxfbgAWwUYt0ZV3LAa zbS+L43GMcldQlKh5iCINwrb+cDkz2W3tf/lDb8P/SBeZmPz9QonvhS+WL09m2dVy4ba luaZU6BIDWoC7W8Fc/yofz/92NUozBt4YuA19zJa1+glLmIUlr/jmx1219dznItn5+xm BdEslgNZzJsIlulDmJB2H1itcbxEE7zX+6o7MRhL9RIleqNcGjZWP1qwaM2kiCPoxAtE awu49WcpeaoTXG+AkpY4xW04JoMPF4NOSIvAOag2LQTfOfrOSfX/KMBol06urciJ68Cd S6Iw== 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=PSKSMduqCH8O+hNFNaBerqHXGiKg3ZUYQNE67ctUZl8=; b=nXrlxtNnfethk9ii6vq/gRNMm1ftAwyLLIHAtryZLHZReS4W7HapMBGlDmOpU0lHeT aEmj4sCcIgddhJpsz4tJRlaXPLdpJ/tlgwaIMPTWMY0cctWoqVVADgFZ0YBBJLaZBnx2 jtXCO47TzjZ3ailcT1POZaUpsHKUTtV+6/swR93a7h2sZbbBEqNUL50jmHkFxrt4vBcj lh5w2uPtamTzBkJJxTeuvVzRMlDfovXQQYY8rmeYERv+Kvwn5t1q7RtZUI+a7buSL0jZ QeyPM62z3FeJC3k7xOKV0pPrsufhxEwGEqXU4Uo0/R6gMWDtTQGU4u/LdEVU1b7GWRed Jz8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nHwmiz3R; 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 j4si18938798pgq.543.2021.10.18.06.32.15; Mon, 18 Oct 2021 06:32:28 -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=nHwmiz3R; 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 S232871AbhJRNdX (ORCPT + 99 others); Mon, 18 Oct 2021 09:33:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:43688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232841AbhJRNba (ORCPT ); Mon, 18 Oct 2021 09:31:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 706B360295; Mon, 18 Oct 2021 13:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563727; bh=OSSrq3kmOhkyY4KrOeBAVTFjERmPuwDFj8ZvTdyL8G0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nHwmiz3RsZkaPosreaCX4LqQqdSqdeUXNuAvZa1eiJHP9e/foK7HAt++HdiCvfrnw PGhxSTMzLTkx6wkaXTHlnRVT5KH5FPddJWGz1qx7PkiDcOPczqZTH7IcIh0uR3MYjf wfahckSUWqJFJ0xdFLJmT2S77L1E2M/JeTdfJCEs= 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 4.19 41/50] pata_legacy: fix a couple uninitialized variable bugs Date: Mon, 18 Oct 2021 15:24:48 +0200 Message-Id: <20211018132327.882743347@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132326.529486647@linuxfoundation.org> References: <20211018132326.529486647@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 @@ -329,7 +329,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); @@ -719,7 +720,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);