Skip to content

Commit

Permalink
drm/nvc0/graph: remove redundant null checks
Browse files Browse the repository at this point in the history
It's safe to call kfree(NULL).

Found by smatch.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Marcin Slusarz authored and Ben Skeggs committed Feb 20, 2013
1 parent fc3109a commit fd69aee
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,19 +613,16 @@ nvc0_graph_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
static void
nvc0_graph_dtor_fw(struct nvc0_graph_fuc *fuc)
{
if (fuc->data) {
kfree(fuc->data);
fuc->data = NULL;
}
kfree(fuc->data);
fuc->data = NULL;
}

void
nvc0_graph_dtor(struct nouveau_object *object)
{
struct nvc0_graph_priv *priv = (void *)object;

if (priv->data)
kfree(priv->data);
kfree(priv->data);

nvc0_graph_dtor_fw(&priv->fuc409c);
nvc0_graph_dtor_fw(&priv->fuc409d);
Expand Down

0 comments on commit fd69aee

Please sign in to comment.