Re: [PATCH 09/14] Big kfree NULL check cleanup - misc remainingdrivers

From: Roland Dreier
Date: Thu Oct 13 2005 - 14:38:13 EST


For what it's worth, the InfiniBand chunk below looks good to me.

Acked-by: Roland Dreier <rolandd@xxxxxxxxx>

--- linux-2.6.14-rc4-orig/drivers/infiniband/core/mad.c 2005-10-11 22:41:09.000000000 +0200
+++ linux-2.6.14-rc4/drivers/infiniband/core/mad.c 2005-10-12 17:37:50.000000000 +0200
@@ -510,8 +510,7 @@ static void unregister_mad_agent(struct
wait_event(mad_agent_priv->wait,
!atomic_read(&mad_agent_priv->refcount));

- if (mad_agent_priv->reg_req)
- kfree(mad_agent_priv->reg_req);
+ kfree(mad_agent_priv->reg_req);
ib_dereg_mr(mad_agent_priv->agent.mr);
kfree(mad_agent_priv);
}
@@ -2544,8 +2543,7 @@ error:
static void destroy_mad_qp(struct ib_mad_qp_info *qp_info)
{
ib_destroy_qp(qp_info->qp);
- if (qp_info->snoop_table)
- kfree(qp_info->snoop_table);
+ kfree(qp_info->snoop_table);
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/