Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8737342ybl; Wed, 25 Dec 2019 05:18:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyadhr5N1JJZ+uPqjIxfQYkjXF5EQJQCYAFCnym/tOT+RR6gLJOknNKe9+v714eOowbbYuM X-Received: by 2002:a9d:5c1:: with SMTP id 59mr45436255otd.192.1577279928056; Wed, 25 Dec 2019 05:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577279928; cv=none; d=google.com; s=arc-20160816; b=S99Bp91ND9TmMmYB3Y03/dluKRAaATo9XDYNoj1URTzG0NSgWQ1x+bedvy/oFxfoaV UbfdoDD+4DEw1er/Jc6xw6Q5rx50DnwTneYCKPcJ+vue6xttTcihHEp56yolQPVb+vM/ h8C6ZiP+diB9XRuDRJa2EvYoHnFdPeOYfruICp/5uwwCRen8LgIT9DUugjhtBRJww1ZZ 56nX7AgOG7Nk/DGocfoNQ2DB94KT7ZHouEerDYklVll0OyNGErri5dJ9CvxV5HhIaBV/ 22EQe8aP9XktfoHk3B0lqXsoJjybjVcBvIrFXghTAiGFJuPIAkivL0/2cFsMBdaybn2R EeUQ== 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=I1gpYCAJMHbW+9eQ/mNk4M4wzGQ+TfBpXguVfCDV9RQ=; b=goi+wujr1/SP+dU2ucfwJBjJbkxqB5iRy2LVt8p1w6DPX5MyN1NAkByjcGYUssWNXR JeimonFo/Ap75aArSDK6XE7j6PUvo9a1j9ejGhadyS8V2pPI1Xu8+iP9AuLZMTu52aW3 1nZF8KRSqoZKDiVUYOCpTqUcS4YGSzw7XCJ+di43/Xpk0QYFH/uGnOSGHxzhZkqzDr2c hlhR1yxst8/ao3zC/RLv6TM75Q3ImBAov9D3FMYpF6bk5FhvOv0ln5AjByBX5hNgUR6h d/wFkNZainaj3DdJDDxPH5DIPYsUep+Uzzy0b4UXRyGn4k3L/EpGZjGaOK1v1gQEck5t D5nQ== 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 k21si8451644otr.1.2019.12.25.05.18.26; Wed, 25 Dec 2019 05:18:48 -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 S1726420AbfLYNQJ (ORCPT + 99 others); Wed, 25 Dec 2019 08:16:09 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:39600 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726353AbfLYNQI (ORCPT ); Wed, 25 Dec 2019 08:16:08 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 64C181EDCB8BF8285E13; Wed, 25 Dec 2019 21:16:02 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Wed, 25 Dec 2019 21:15:54 +0800 From: yu kuai To: , , , CC: , , , , Subject: [PATCH] MIPS: ralink: add missing put_device in ill_acc_of_setup Date: Wed, 25 Dec 2019 21:15:20 +0800 Message-ID: <20191225131520.2505-1-yukuai3@huawei.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If of_find_device_by_node return 0 and ill_acc_of_setup return error, pdev don't have a corresponding object release. Fix it by adding put_device. Signed-off-by: yu kuai --- arch/mips/ralink/ill_acc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c index 0ddeb31afa93..bdf53807d7c2 100644 --- a/arch/mips/ralink/ill_acc.c +++ b/arch/mips/ralink/ill_acc.c @@ -67,11 +67,13 @@ static int __init ill_acc_of_setup(void) irq = irq_of_parse_and_map(np, 0); if (!irq) { dev_err(&pdev->dev, "failed to get irq\n"); + put_device(&pdev->dev); return -EINVAL; } if (request_irq(irq, ill_acc_irq_handler, 0, "ill_acc", &pdev->dev)) { dev_err(&pdev->dev, "failed to request irq\n"); + put_device(&pdev->dev); return -EINVAL; } -- 2.17.2