From patchwork Fri Sep 21 07:06:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 185596 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A10B22C007A for ; Fri, 21 Sep 2012 17:06:16 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752883Ab2IUHGM (ORCPT ); Fri, 21 Sep 2012 03:06:12 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:56230 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752308Ab2IUHGL (ORCPT ); Fri, 21 Sep 2012 03:06:11 -0400 Received: by qaas11 with SMTP id s11so1024257qaa.19 for ; Fri, 21 Sep 2012 00:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=JepzsOvQxVLw3+HH5t0eOlidqF394PowVGKBglzczvQ=; b=TuFuzhKSSHJLP3CWD5/m3BuIFPVH96SX30JX7+W5lmXFxU6NcZqo9N91nRnqJGJLGC SU4CrCknO8l5CYyiGm3ngGaYffkn76ITLIG5lwHuXn4pzMjZOatO5xFWpL9avxkCh46Y NSYOkOxIfOx7NFvLzh30yts0c+THofb150stXekKWP31S6XLvRYPEv2iu1vrVlFTEMtX XSBNXm5EggIgD4bTNoOpjwhqaeqQGkM5ZOZ91l+LW2O+M9gbu30bMi6i/pevAJ9fJHat us8lGXT2CN8VF9SmcxqUXsvlC1zEYWIKbUS3AeoXjxq/g51qCVGQMm4rX4IvavAnx3fq Xxxg== MIME-Version: 1.0 Received: by 10.224.196.132 with SMTP id eg4mr10171871qab.93.1348211170383; Fri, 21 Sep 2012 00:06:10 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Fri, 21 Sep 2012 00:06:10 -0700 (PDT) Date: Fri, 21 Sep 2012 15:06:10 +0800 Message-ID: Subject: [PATCH] stmmac: fix return value check in stmmac_open_ext_timer() From: Wei Yongjun To: peppe.cavallaro@st.com Cc: yongjun_wei@trendmicro.com.cn, netdev@vger.kernel.org Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Wei Yongjun In case of error, the function clk_get() returns ERR_PTR() and never returns NULL pointer. The NULL test in the error handling should be replaced with IS_ERR(). dpatch engine is used to auto generated this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" 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/net/ethernet/stmicro/stmmac/stmmac_timer.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c index 2a0e1ab..197fb8c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c @@ -109,7 +109,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) { timer_clock = clk_get(NULL, TMU_CHANNEL); - if (timer_clock == NULL) + if (IS_ERR(timer_clock)) return -1; if (tmu2_register_user(stmmac_timer_handler, (void *)dev) < 0) {