Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3016255pxb; Mon, 18 Oct 2021 06:40:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPoEdvmHLWj/PTma7f1rKqkzlW76xaQb0npXdIjh0+hZN276Wrug7EWMpP+xnRMsebaVI0 X-Received: by 2002:aa7:9197:0:b0:44d:a2e9:72cf with SMTP id x23-20020aa79197000000b0044da2e972cfmr17991795pfa.38.1634564404284; Mon, 18 Oct 2021 06:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634564404; cv=none; d=google.com; s=arc-20160816; b=Y10dZXxNcZXJOnZYfkzhu2///qXdjgANeCU2M9KsWhOcaZ/4yHYaX9vGxEaxtf10gX TuihJRNLMC564VHtMSkUWRxjacMeByGf0uy+qQGxrgb/mJqUaEXuYy8XYtjcwsSKtTAI 2hI01Y4nPPSXJXstMuM1O/TjMH6X3sV/y41cNDm9KhUDALOuPcE5SLoezF7by/nk2YOp 5jMjh2AZD8p7RQt4mthywmBjkFN6TEXjdNtt7BwnHdVHdjE/4S+BFsuEXDH+Z81T2MgI Kbhm4Z03SEnDnQJqTJIQyep1KRXtJ4KkZFuysTaXRqM/etwzoeEU7LQkTwjHMQOic29n 7YoA== 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=ZV/Z4NruLvfqT3X5bQTcHEFPOfC0oBfP2n3YupofDl4=; b=l1s33ZKWtqRIdVq0SQ0jz4CqQYKLa78X0YbVTtH7Uodc58zYz8q6nswq137khXp+rH HnLZx/+Lo8wM6QiOLyJ5rI2CHK9kkDFWHzM+U7WhwIZNaeiRk5efjXQSpferK4xKdtxE dil4DfsE6aJHd0cEtKWKhi+YXoXAL2ZJGMEXtYCGlqo1I9OB7gPEQyt8iUGLlXOaEhG5 Sjg/+WFk3TFzPs1g0raXWGktPZhYwBnKYwRV1T4/TeRtU+uUnlcJ0hex/Qp9S2QvznYG msL7sFC4WTC4hnEgHJ7o7vozhYUFMKmKLdKtCo1CsjtjBlafF+up8O8Nmc2v1gENz2cB 37vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=032j5xOL; 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 j69si6117721pgd.326.2021.10.18.06.39.51; Mon, 18 Oct 2021 06:40:04 -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=032j5xOL; 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 S233712AbhJRNk4 (ORCPT + 99 others); Mon, 18 Oct 2021 09:40:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:53902 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233806AbhJRNiv (ORCPT ); Mon, 18 Oct 2021 09:38:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2891861356; Mon, 18 Oct 2021 13:32:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563940; bh=wIS/+nGfYRfxZzuBiD4QPhkeWqMzIK0zUJQOPbgbDwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=032j5xOLb3wh7Xy+dw5l3GE8RWsJVPyNMAXwLB4bj3KB798zh2G27KLjyEhmPlAYM W+ah4JWHANEwS3mDK+GgK9HBA83gccQ7pi0ZhtxuLwReqQM+gRyd1VF4R81stva87l Bxze0yMI1MG0cR4CEKS2HcplAPB7v4r8KnHyXVDQ= 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.4 56/69] pata_legacy: fix a couple uninitialized variable bugs Date: Mon, 18 Oct 2021 15:24:54 +0200 Message-Id: <20211018132331.331510851@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132329.453964125@linuxfoundation.org> References: <20211018132329.453964125@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 @@ -315,7 +315,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); @@ -705,7 +706,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);