[staging:staging-next 800/1248] drivers/staging/lustre/lustre/llite/llite_lib.c:2525:9-16: WARNING opportunity for memdup_user

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next
head:   fc1e2c8ea85e109acf09e74789e9b852f6eed251
commit: dbf789ce9d45721f990a993c7b1e61b998470a90 [800/1248] staging: lustre: llite: allow setting stripes to specify OSTs


coccinelle warnings: (new ones prefixed by >>)

>> drivers/staging/lustre/lustre/llite/llite_lib.c:2525:9-16: WARNING opportunity for memdup_user

vim +2525 drivers/staging/lustre/lustre/llite/llite_lib.c

  2509	
  2510	ssize_t ll_copy_user_md(const struct lov_user_md __user *md,
  2511				struct lov_user_md **kbuf)
  2512	{
  2513		struct lov_user_md lum;
  2514		ssize_t lum_size;
  2515	
  2516		if (copy_from_user(&lum, md, sizeof(lum))) {
  2517			lum_size = -EFAULT;
  2518			goto no_kbuf;
  2519		}
  2520	
  2521		lum_size = ll_lov_user_md_size(&lum);
  2522		if (lum_size < 0)
  2523			goto no_kbuf;
  2524	
> 2525		*kbuf = kzalloc(lum_size, GFP_NOFS);
  2526		if (!*kbuf) {
  2527			lum_size = -ENOMEM;
  2528			goto no_kbuf;
  2529		}
  2530	
  2531		if (copy_from_user(*kbuf, md, lum_size) != 0) {
  2532			kfree(*kbuf);
  2533			*kbuf = NULL;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux