* re: drm/amdgpu: add core driver (v4)
@ 2015-06-10 15:41 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-06-10 15:41 UTC (permalink / raw)
To: alexander.deucher; +Cc: dri-devel
Hello Alex Deucher,
This is a semi-automatic email about new static checker warnings.
The patch d38ceaf99ed0: "drm/amdgpu: add core driver (v4)" from Apr
20, 2015, leads to the following Smatch complaint:
drivers/gpu/drm/amd/amdgpu/atombios_i2c.c:68 amdgpu_atombios_i2c_process_i2c_ch()
error: we previously assumed 'buf' could be null (see line 61)
drivers/gpu/drm/amd/amdgpu/atombios_i2c.c
60 }
61 if (buf == NULL)
^^^^^^^^^^^
Check.
62 args.ucRegIndex = 0;
63 else
64 args.ucRegIndex = buf[0];
65 if (num)
66 num--;
67 if (num)
68 memcpy(&out, &buf[1], num);
^^^^^
Not checked. It's possible it was intended to set "num" ot zero instead
of args.ucRegIndex? Also memcpy() with a size zero is a no-op so the if
statement could be removed if you want.
69 args.lpI2CDataOut = cpu_to_le16(out);
70 } else {
regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-10 15:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 15:41 drm/amdgpu: add core driver (v4) Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox