From: Dan Carpenter <dan.carpenter@oracle.com>
To: alexander.deucher@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/amdgpu: add core driver (v4)
Date: Wed, 10 Jun 2015 18:41:51 +0300 [thread overview]
Message-ID: <20150610154150.GE10549@mwanda> (raw)
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
reply other threads:[~2015-06-10 15:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150610154150.GE10549@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alexander.deucher@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.