summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2013-01-27 16:11:18 +0100
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 16:00:37 +1000
commitfd69aee4271ead4bf5c759aeaf4f16ab3d63322f (patch)
tree0185ae3c66b113ea95f015a06635c83d4fc22877 /drivers
parentfc3109a2cb294335bcf3c5db5e16ae5fe68849f2 (diff)
downloadlinux-3.10-fd69aee4271ead4bf5c759aeaf4f16ab3d63322f.tar.gz
linux-3.10-fd69aee4271ead4bf5c759aeaf4f16ab3d63322f.tar.bz2
linux-3.10-fd69aee4271ead4bf5c759aeaf4f16ab3d63322f.zip
drm/nvc0/graph: remove redundant null checks
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
index 15bfe55f510..0de0dd724af 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
@@ -613,10 +613,8 @@ 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
@@ -624,8 +622,7 @@ 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);