Skip to content

Commit

Permalink
stmmac: fix return value check in stmmac_open_ext_timer()
Browse files Browse the repository at this point in the history
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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Sep 21, 2012
1 parent 28889b7 commit 6861509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6861509

Please sign in to comment.