Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp452139imu; Tue, 22 Jan 2019 23:01:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN5FZSZVD1usJu5e0XjLE1dVH8ah5CcRxwCUA5IRUrGGJxifTnJmM28MI5rmsv+uTsbz9ssC X-Received: by 2002:a17:902:292b:: with SMTP id g40mr1126228plb.82.1548226865047; Tue, 22 Jan 2019 23:01:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548226865; cv=none; d=google.com; s=arc-20160816; b=Tcarut+j5xhTsHFf0Wmaj28f2GkVfKA5PW6nYAhNtiNjZeDB00VPyhcf+CMYOiYogy B9h7Xtgu1lGd++AtEUP6isETmNSRxJlKdXBYXZmFjjuFNvUYp4At3dDN3z6++g49EwMO 3l0z+Os/LihX4MCeVwOIB0xqfQlrcQbwnYjspcwOVJOv1v60IwhUUoIXphf7PTKiGejF UCGD7whm4Ck9GQGB8860cmYb2FDmCplUeDKbk/QdDKcrFM0nMh5Wld1W0JN/qRwQrSH5 FojqRVOR7o13XdMj4TLz8g625DkzlSMsifkK3uIAwNEyn7uRWv/z9AO5rJ3Xv9tJq4n7 HVzw== 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; bh=RwQTyMIgFllet4hfGcq0sG75e/beZbyLkW8T9T+0VOk=; b=wWuuZ77+eBEj6E0ImQ6sHFoaJkvehVhw4hoAjkixdwRNX0JJqoGLaHG+SvQWe9KFXN Xqw+UwFYw7dwu6xKZ+GRs+t+TKMJ/i+Von0Z5dgpPxDsKl6BIa8QSmY66m6uD9SrtNGR kiW6eAQ0MazctOeiEo0Etd2d2lvutB1Dz26p6B7Vz8vx8q/Gi/wLOrkhiqgY5lXPH66Q C5pqeDAU+iN+zf/J7aMXoAaJ85lJgjg20Y5MWIouyrHOZSVuyd5SXjDo5+6586R9R+yn MTVswishtTRwcNw8s9dVFj845PgLkIwfI7F/yLlp7+f2MPUrt6yg91XIUliwoRzY87z6 oPMA== 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 j11si18333364pgk.265.2019.01.22.23.00.49; Tue, 22 Jan 2019 23:01:05 -0800 (PST) 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 S1726229AbfAWG7D (ORCPT + 99 others); Wed, 23 Jan 2019 01:59:03 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:2292 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726029AbfAWG7C (ORCPT ); Wed, 23 Jan 2019 01:59:02 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 734EBFE661120ABB02CE; Wed, 23 Jan 2019 14:59:00 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.408.0; Wed, 23 Jan 2019 14:58:53 +0800 From: YueHaibing To: , , , , , CC: , , YueHaibing Subject: [PATCH -next] mtd: docg3: Fix passing zero to 'PTR_ERR' warning in doc_probe_device Date: Wed, 23 Jan 2019 14:58:27 +0800 Message-ID: <20190123065827.16748-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected 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/mtd/devices/docg3.c:1875 doc_probe_device() warn: passing zero to 'ERR_PTR' Fixes: ae9d4934b2d7 ("mtd: docg3: add multiple floor support") Signed-off-by: YueHaibing --- drivers/mtd/devices/docg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index 4c94fc0..60ddc38 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c @@ -1872,7 +1872,7 @@ doc_probe_device(struct docg3_cascade *cascade, int floor, struct device *dev) nomem2: kfree(docg3); nomem1: - return ERR_PTR(ret); + return ret ? ERR_PTR(ret) : NULL; } /** -- 2.7.0