From patchwork Sun Apr 13 18:46:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 3974681 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3BE00BFF02 for ; Sun, 13 Apr 2014 18:51:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67BAE20251 for ; Sun, 13 Apr 2014 18:51:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 440772024D for ; Sun, 13 Apr 2014 18:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754814AbaDMSvc (ORCPT ); Sun, 13 Apr 2014 14:51:32 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:54320 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754610AbaDMSvc (ORCPT ); Sun, 13 Apr 2014 14:51:32 -0400 X-Greylist: delayed 301 seconds by postgrey-1.27 at vger.kernel.org; Sun, 13 Apr 2014 14:51:32 EDT Received: from ayla.of.borg ([84.193.72.141]) by xavier.telenet-ops.be with bizsmtp id pWmV1n00832ts5g01WmVvM; Sun, 13 Apr 2014 20:46:30 +0200 Received: from geert by ayla.of.borg with local (Exim 4.76) (envelope-from ) id 1WZPQD-0007Js-0N; Sun, 13 Apr 2014 20:46:29 +0200 From: Geert Uytterhoeven To: Linus Torvalds , Alexander Viro , Andrew Morton Cc: Steve French , linux-cifs@vger.kernel.org, Hugh Dickins , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/2] mm: Initialize error in shmem_file_aio_read() Date: Sun, 13 Apr 2014 20:46:22 +0200 Message-Id: <1397414783-28098-2-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397414783-28098-1-git-send-email-geert@linux-m68k.org> References: <1397414783-28098-1-git-send-email-geert@linux-m68k.org> MIME-Version: 1.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP mm/shmem.c: In function ‘shmem_file_aio_read’: mm/shmem.c:1414: warning: ‘error’ may be used uninitialized in this function If the loop is aborted during the first iteration by one of the two first break statements, error will be uninitialized. Introduced by commit 6e58e79db8a16222b31fc8da1ca2ac2dccfc4237 ("introduce copy_page_to_iter, kill loop over iovec in generic_file_aio_read()"). Signed-off-by: Geert Uytterhoeven --- The code is too complex to see if this is an obvious false positive. mm/shmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/shmem.c b/mm/shmem.c index 8f1a95406bae..9f70e02111c6 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1411,7 +1411,7 @@ static ssize_t shmem_file_aio_read(struct kiocb *iocb, pgoff_t index; unsigned long offset; enum sgp_type sgp = SGP_READ; - int error; + int error = 0; ssize_t retval; size_t count; loff_t *ppos = &iocb->ki_pos;