Skip to contentSkip to conversation

drm/nouveau/fence: convert to exec engine, and improve channel sync

DISCUSSION Dan Carpenter 1 participant 1 message Sep 26, 2012

lore
Share & tools
lore
#0 lore raw

Hello Ben Skeggs,

This is a semi-automatic email about new static checker warnings.

I'm not sure why I didn't send this when the code was first submitted.

The patch 5e120f6e4b3f: "drm/nouveau/fence: convert to exec engine, and improve channel sync" from Apr 30, 2012, leads to the following Smatch complaint:

drivers/gpu/drm/nouveau/nouveau_fence.c:204 nouveau_fence_new()
warn: variable dereferenced before check 'chan' (see line 196)

drivers/gpu/drm/nouveau/nouveau_fence.c
195
196 if (unlikely(!chan->engctx[NVOBJ_ENGINE_FENCE]))

                              ^^^^^^^^^^^^

New dereference.

197 return -ENODEV;
198
199 fence = kzalloc(sizeof(*fence), GFP_KERNEL);
200 if (!fence)
201 return -ENOMEM;
202 kref_init(&fence->kref);
203

   204		if (chan) {
                   ^^^^^^

Old check.

   205			ret = nouveau_fence_emit(fence, chan);
   206			if (ret)

regards,
dan carpenter

See also: