re: drm/amdgpu: add core driver (v4)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux