Re: [PATCH] virtio_console: Assure used length from device is limited

From
kernel test robot <hidden>
Date
2021-05-25 10:45:05
Also in
lkml, oe-kbuild-all
Hi Xie,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on v5.13-rc3 next-20210525]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Xie-Yongji/virtio_console-Assure-used-length-from-device-is-limited/20210525-125848
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 281e468446994a7672733af2bf941f4110d4a895
config: x86_64-randconfig-s022-20210525 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/edaca17a036c98c3e0f6953318976caff7168a6e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Xie-Yongji/virtio_console-Assure-used-length-from-device-is-limited/20210525-125848
        git checkout edaca17a036c98c3e0f6953318976caff7168a6e
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>


sparse warnings: (new ones prefixed by >>)
quoted
drivers/char/virtio_console.c:478:28: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/char/virtio_console.c:478:28: sparse:    unsigned int *
drivers/char/virtio_console.c:478:28: sparse:    unsigned long *
   drivers/char/virtio_console.c:1712:28: sparse: sparse: incompatible types in comparison expression (different type sizes):
   drivers/char/virtio_console.c:1712:28: sparse:    unsigned int *
   drivers/char/virtio_console.c:1712:28: sparse:    unsigned long *

vim +478 drivers/char/virtio_console.c

   466	
   467	/* Callers should take appropriate locks */
   468	static struct port_buffer *get_inbuf(struct port *port)
   469	{
   470		struct port_buffer *buf;
   471		unsigned int len;
   472	
   473		if (port->inbuf)
   474			return port->inbuf;
   475	
   476		buf = virtqueue_get_buf(port->in_vq, &len);
   477		if (buf) {
 > 478			buf->len = min(len, buf->size);
   479			buf->offset = 0;
   480			port->stats.bytes_received += len;
   481		}
   482		return buf;
   483	}
   484	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Attachments

Thread (1 message) 1 message, 1 author, last reply 2021-05-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help