From patchwork Thu Jul 13 07:46:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 107569 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1885481qge; Thu, 13 Jul 2017 00:53:09 -0700 (PDT) X-Received: by 10.98.35.214 with SMTP id q83mr60736328pfj.101.1499932389393; Thu, 13 Jul 2017 00:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499932389; cv=none; d=google.com; s=arc-20160816; b=PEWUhvqgG4NlCgCdy+bTf7ECHzmUymHfFRtqI6yiv1smylM93P0QvvWfiWbebnojcN OWxcgrrpeEPBX/v8Z/lcy9+auKU6kQ4RZAFgi+4mwQvZ/qKIk++a3gYe9MXSo16qFCQE 46d0DWWDiqaAA0yePX7KqUmJhewtdU4aEk5MvKPBmLBI5U0Bk+Hw1mLbO0IkvX2cLuYg /eg1YvXFTPYg/X/V5yx7leUjH0jI2CkqgEoXHbD5PeLOLP5rYY5T/Pr2bjqtz38AtBkS UtFVqr6wxwnViFBLcPY2SintvppGgtgEyfS603mZcJW9gfiK8L4CCIUpfW2HD3EK/kSr tNew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=C+QdlZEPOFM9aPtLli6Ri9jrQ/zJQdh0Valr/uBC6VI=; b=m+dyM8EnC8eNZVbsGt3F61I9bS0hY7lfdCPuDIUpwKOv3GY+R+atmPFAWYXGs5Yny5 zJC/vcUpvRBsTa+kmYdKJ69VF4+v/2WJUuErq6yMKKxm9BMaWHwG/OVb38PlXAwWGxaU zOLlg74Ke9dkVdlyAu/Wk0CcrEAxPIioqKjiGlbq6hip/EwqjsIyMJpj/gUHcRxGV4N4 oJo7XyaqBvDXkJ3izjD8xt3C12Z85BA064x2d7I4YnkVS4HfOYEdmikQctgeP0aqX5S1 RqX0a4dvczI81Yqw/0hVmLBOqjE7Kg8GAisuSphSM0iq/Rq9BWIQ7sR50IPgbrRx3++O os4w== ARC-Authentication-Results: i=1; mx.google.com; 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 1si3752874pgm.406.2017.07.13.00.53.09; Thu, 13 Jul 2017 00:53:09 -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; 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 S1751237AbdGMHxH (ORCPT + 25 others); Thu, 13 Jul 2017 03:53:07 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:9762 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbdGMHxG (ORCPT ); Thu, 13 Jul 2017 03:53:06 -0400 Received: from 172.30.72.56 (EHLO dggeml406-hub.china.huawei.com) ([172.30.72.56]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id ASA37949; Thu, 13 Jul 2017 15:53:02 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by dggeml406-hub.china.huawei.com (10.3.17.50) with Microsoft SMTP Server id 14.3.301.0; Thu, 13 Jul 2017 15:52:52 +0800 From: Kefeng Wang To: Ilya Dryomov , Sage Weil , Alex Elder , Mike Christie CC: , Kefeng Wang Subject: [PATCH] rbd: Fix uninitialized variable use in rbd_acquire_lock Date: Thu, 13 Jul 2017 15:46:35 +0800 Message-ID: <1499931995-64900-1-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.596726DE.006E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6488ae346373e60ea9e593d2e0ca6567 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org drivers/block/rbd.c: In function 'rbd_acquire_lock': drivers/block/rbd.c:3602:44: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] Silence the warning, found it when built old kernel(3.10) with OBS(opensuse build service). Signed-off-by: Kefeng Wang --- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.12.4 diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b008b6a..b640ad8 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3435,7 +3435,7 @@ static void rbd_acquire_lock(struct work_struct *work) struct rbd_device *rbd_dev = container_of(to_delayed_work(work), struct rbd_device, lock_dwork); enum rbd_lock_state lock_state; - int ret; + int ret = 0; dout("%s rbd_dev %p\n", __func__, rbd_dev); again: