From patchwork Tue Jun 14 00:26:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 634972 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rT9Sl6XfWz9sBM for ; Tue, 14 Jun 2016 10:27:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=163.com header.i=@163.com header.b=gG8tHQwM; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422876AbcFNA1D (ORCPT ); Mon, 13 Jun 2016 20:27:03 -0400 Received: from m12-14.163.com ([220.181.12.14]:42459 "EHLO m12-14.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422645AbcFNA1B (ORCPT ); Mon, 13 Jun 2016 20:27:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Q++d9 6N40fMhzlm3NmO+UV0W8o6E91Phg5JmTNPXK/o=; b=gG8tHQwMLJrc0u0WT9hb3 +5M9+Wp8nReOvzUJf9W0atpfjvBxW00/Ybs41JrvtWyfewfOmQouxwM9nIVfsotd 2r8BZWxlFMXinTr+RxJIFkUcnJuUsSqPa7yAGdU6ejiXFD9m6Hpq3VU4KOK9QhTt pYL3MUbOC4Ly/7OqdUjUD4= Received: from localhost.localdomain.localdomain (unknown [180.102.102.213]) by smtp10 (Coremail) with SMTP id DsCowACXxUJJT19XZudmAw--.29274S3; Tue, 14 Jun 2016 08:26:51 +0800 (CST) From: weiyj_lk@163.com To: Tejun Heo , Brijesh Singh Cc: Wei Yongjun , linux-ide@vger.kernel.org Subject: [PATCH] ata: fix return value check in ahci_seattle_get_port_info() Date: Tue, 14 Jun 2016 00:26:49 +0000 Message-Id: <1465864009-26774-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-CM-TRANSID: DsCowACXxUJJT19XZudmAw--.29274S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Wr4kZr1rZrWUGw4kXFWUArb_yoWfJwbE9r WfXrnrGwn8KFnrtr1UAr4avFyak3W5ur1kuF15K3W3Jr98Xr1rGF9rZrnIgrnFvrWFyrZI kFnIqr1Yvw17JjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0iID7UUUUU== X-Originating-IP: [180.102.102.213] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/xtbByguI1lO+j+ijlAAAsi Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Wei Yongjun In case of error, the function devm_kzalloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun Acked-by: Brijesh Singh --- drivers/ata/ahci_seattle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c index 6e702ab..1d31c0c 100644 --- a/drivers/ata/ahci_seattle.c +++ b/drivers/ata/ahci_seattle.c @@ -137,7 +137,7 @@ static const struct ata_port_info *ahci_seattle_get_port_info( u32 val; plat_data = devm_kzalloc(dev, sizeof(*plat_data), GFP_KERNEL); - if (IS_ERR(plat_data)) + if (!plat_data) return &ahci_port_info; plat_data->sgpio_ctrl = devm_ioremap_resource(dev,