Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp394776ybt; Wed, 24 Jun 2020 01:50:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVBmFaytmPAwtaYZkyB7juq/HMUEPBySdEE7enEg1nwBcwDGOUvgG6zloueGUmeMXwOWR+ X-Received: by 2002:a17:906:cd2:: with SMTP id l18mr12893281ejh.18.1592988631600; Wed, 24 Jun 2020 01:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592988631; cv=none; d=google.com; s=arc-20160816; b=KhWrZ7WWFeLsWpiH23leoePSvoyrQiUrKUhn9GYlfxBwuk4NpwVOLEpqxQXh1oicqD R1EuofrGBXTFLVlU4r+Vk0V5cCL36MWuyTTbB5MkXcOpy8KnXSmvcBuzXfLYc/1KKzG0 m6JsOMrVa7NJI/VULUsQZ6OhgT2xUa0jOpZOjB4FwOAxL9tt9/aTs0TYoXhC9z8OciL0 6FIqj7f8IayZdM+F/ESKlh/gNXIwGb2YachCbg40mgQJ+0s5rUxHPZkyToqp52mYRsru xWwEqtq4dwUOIjbFMQt//vGcdTw1dbmgnc0dxO1wKuI7LvSPvlyugIrWUZ2jZZT6aeDs lfew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=VmpRYbG384AqTgXBe2lxZjLOYxnBOmGUrgtp63bfmJ0=; b=QMM8pZU/HEmSmR3uLM/xPRGI91gJ8y8+pKHwMldjmqVNpCmn0PelZ293CZivDgHCge 58LTcufdD9OxCj4Ly0dfVl8ftze79iKcOmk+MHElhjUFUgHiMaXFHHpXx3JShf4La9cZ RU8GMnsafohZ8VMItWS1N4gKVOpZv/CXzXG3cXUXTPl+S5lZdRw9fKBSifa3FZ8wj9U+ rusPa2/uFOuyfdV5GYZmtCbV/yBdRHmDCmujmGTL/8Klgvgv94LaVqraqWENAu2vTAnz JHqhPg4529IMHIYpjnUE66C/G1XZoL6VIjuWPWK7oU5oQ4HE7KS40hVbwxCZtWiOPzBJ RhXg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si3974109eds.221.2020.06.24.01.50.08; Wed, 24 Jun 2020 01:50:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389164AbgFXItb (ORCPT + 99 others); Wed, 24 Jun 2020 04:49:31 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:5596 "EHLO cmccmta3.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388830AbgFXItZ (ORCPT ); Wed, 24 Jun 2020 04:49:25 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.1]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec5ef31384808-51d08; Wed, 24 Jun 2020 16:49:08 +0800 (CST) X-RM-TRANSID: 2eec5ef31384808-51d08 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.105.0.242]) by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee15ef31383538-2ae1e; Wed, 24 Jun 2020 16:49:08 +0800 (CST) X-RM-TRANSID: 2ee15ef31383538-2ae1e From: Ding Xiang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] loop: fix passing zero to 'PTR_ERR' warning Date: Wed, 24 Jun 2020 16:48:42 +0800 Message-Id: <1592988522-4350-1-git-send-email-dingxiang@cmss.chinamobile.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a static code checker warning: drivers/block/loop.c:798 loop_attr_backing_file_show() warn: passing zero to 'PTR_ERR' Signed-off-by: Ding Xiang --- drivers/block/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 475e1a7..bcada87 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -795,7 +795,7 @@ static ssize_t loop_attr_backing_file_show(struct loop_device *lo, char *buf) spin_unlock_irq(&lo->lo_lock); if (IS_ERR_OR_NULL(p)) - ret = PTR_ERR(p); + ret = PTR_ERR_OR_ZERO(p); else { ret = strlen(p); memmove(buf, p, ret); -- 2.7.4