Re: [kbuild] [regulator:topic/da9211 1/1] drivers/regulator/da9211-regulator.c:268 da9211_regulator_init() warn: variable dereferenced before check 'chip-pdata' (see line 260)

2014-07-15 Thread Dan Carpenter
On Tue, Jul 15, 2014 at 08:53:52AM +, Opensource [James Seong-Won Ban] 
wrote:
 Hi Dan,
 
 There is no problem in the code because the pdata is checked before the 
 function.
 Do I have to do something?

The checker is saying that the code doesn't make sense as-is becuase we
dereference chip-pdata and we have a check to see if it is NULL.  The
check doesn't make sense because we would have crashed already at that
point.  You are saying that the extra check for chip-pdata is not
needed.

if (chip-pdata)
config.init_data =
(chip-pdata-init_data[i]);

Just delete it then.  That way the code will make sense and be
consistent.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [tty:tty-next 68/69] drivers/tty/serial/serial_core.c:2621 uart_add_one_port() warn: double check that we're allocating correct size: 4 vs 16

2014-07-22 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
head:   aef9a7bd9b676f797dd5cefd43deb30d36b976a9
commit: 266dcff03eed0050b6af11aaf2a61ab837d7ba3f [68/69] Serial: allow port 
drivers to have a default attribute group

New smatch warnings:
drivers/tty/serial/serial_core.c:2621 uart_add_one_port() warn: double check 
that we're allocating correct size: 4 vs 16

git remote add tty git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
git remote update tty
git checkout 266dcff03eed0050b6af11aaf2a61ab837d7ba3f
vim +2621 drivers/tty/serial/serial_core.c

^1da177e drivers/serial/serial_core.c Linus Torvalds 2005-04-16  2605  
976ecd12 drivers/serial/serial_core.c Russell King   2005-07-03  2606   
/*
976ecd12 drivers/serial/serial_core.c Russell King   2005-07-03  2607   
 * If this port is a console, then the spinlock is already
976ecd12 drivers/serial/serial_core.c Russell King   2005-07-03  2608   
 * initialised.
976ecd12 drivers/serial/serial_core.c Russell King   2005-07-03  2609   
 */
a2bceae0 drivers/serial/serial_core.c Alan Cox   2009-09-19  2610   
if (!(uart_console(uport)  (uport-cons-flags  CON_ENABLED))) {
a2bceae0 drivers/serial/serial_core.c Alan Cox   2009-09-19  2611   
spin_lock_init(uport-lock);
a2bceae0 drivers/serial/serial_core.c Alan Cox   2009-09-19  2612   
lockdep_set_class(uport-lock, port_lock_key);
13e83599 drivers/serial/serial_core.c Ingo Molnar2006-07-03  2613   
}
976ecd12 drivers/serial/serial_core.c Russell King   2005-07-03  2614  
a2bceae0 drivers/serial/serial_core.c Alan Cox   2009-09-19  2615   
uart_configure_port(drv, state, uport);
^1da177e drivers/serial/serial_core.c Linus Torvalds 2005-04-16  2616  
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2617   
num_groups = 2;
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2618   
if (uport-attr_group)
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2619   
num_groups++;
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2620  
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16 @2621   
uport-tty_groups = kcalloc(num_groups, sizeof(**uport-tty_groups),
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2622   
GFP_KERNEL);

Probably sizeof(*uport-tty_groups) was intended?  It looks like the
current code allocates too much data.

266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2623   
if (!uport-tty_groups) {
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2624   
ret = -ENOMEM;
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2625   
goto out;
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2626   
}
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2627   
uport-tty_groups[0] = tty_dev_attr_group;
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2628   
if (uport-attr_group)
266dcff0 drivers/tty/serial/serial_core.c Greg Kroah-Hartman 2014-07-16  2629   
uport-tty_groups[1] = uport-attr_group;

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [jbarnes:fd-fences 1/1] drivers/gpu/drm/i915/i915_fence.c:308 i915_gem_fence_ioctl() warn: possible memory leak of 'intel_fence'

2014-07-22 Thread Dan Carpenter
[ mopping up remaining warnings from when I was on vacation -dan ]

tree:   git://people.freedesktop.org/~jbarnes/linux fd-fences
head:   8291fca8b24b71f1db17126c71b2bff91f22aa0f
commit: 8291fca8b24b71f1db17126c71b2bff91f22aa0f [1/1] drm/i915: add fence 
ioctl v2

drivers/gpu/drm/i915/i915_fence.c:308 i915_gem_fence_ioctl() warn: possible 
memory leak of 'intel_fence'
drivers/gpu/drm/i915/i915_fence.c:313 i915_gem_fence_ioctl() error: double free 
of 'intel_fence'

git remote add jbarnes git://people.freedesktop.org/~jbarnes/linux
git remote update jbarnes
git checkout 8291fca8b24b71f1db17126c71b2bff91f22aa0f
vim +/intel_fence +308 drivers/gpu/drm/i915/i915_fence.c

8291fca8 Jesse Barnes 2014-06-19  302  
8291fca8 Jesse Barnes 2014-06-19  303   fence-fd = fd;
8291fca8 Jesse Barnes 2014-06-19  304  
8291fca8 Jesse Barnes 2014-06-19  305   mutex_unlock(dev-struct_mutex);
8291fca8 Jesse Barnes 2014-06-19  306  
8291fca8 Jesse Barnes 2014-06-19  307  out:
8291fca8 Jesse Barnes 2014-06-19 @308   return ret;
8291fca8 Jesse Barnes 2014-06-19  309  
8291fca8 Jesse Barnes 2014-06-19  310  err_free_file:
8291fca8 Jesse Barnes 2014-06-19  311   fput(file);
8291fca8 Jesse Barnes 2014-06-19  312  err:
8291fca8 Jesse Barnes 2014-06-19 @313   kfree(intel_fence);
8291fca8 Jesse Barnes 2014-06-19  314   mutex_unlock(dev-struct_mutex);
8291fca8 Jesse Barnes 2014-06-19  315   return ret;
8291fca8 Jesse Barnes 2014-06-19  316  }

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [gpio:for-next 14/19] drivers/gpio/gpiolib-sysfs.c:817:7-11: ERROR: iterator variable bound on line 816 cannot be NULL

2014-07-23 Thread Dan Carpenter
On Wed, Jul 23, 2014 at 01:41:33PM +0800, Fengguang Wu wrote:
 Hi Alexandre,
 
 On Wed, Jul 23, 2014 at 02:19:38PM +0900, Alexandre Courbot wrote:
  Oh, nice one. Linus, do you need a fixup patch?
  
  PS: for some reason the kbuild mails seem to not arrive on my end despite
  being the main recipient (this is the first mail I received about this
  issue). They are not even showing up in my spam folder. Any idea how I could
  debug this?
 
 The TO/CC is in the email body rather than email head. :)
 
 It's a low confident warning, so is first sent to the kbuild list
 for manual check:
 
 https://lists.01.org/pipermail/kbuild/2014-July/001629.html
 
 Julia noticed it and added you to the CC list.


Julia, I never get your emails so I sometimes send duplicate reports.

Are other people forwarding the manual check emails?  I am the only
person who CC's the kbuild list, I think?

regards,
dan carpenter


___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [ubifs:master 18/23] drivers/mtd/ubi/block.c:508 ubiblock_resize() error: potentially dereferencing uninitialized 'dev'.

2014-07-31 Thread Dan Carpenter
I sent this one earlier this morning.

regards,
dan carpenter

On Thu, Jul 31, 2014 at 09:28:26PM +0800, kbuild test robot wrote:
 TO: Richard Weinberger rich...@nod.at
 CC: Artem Bityutskiy artem.bityuts...@linux.intel.com
 CC: Ezequiel Garcia ezequiel.gar...@free-electrons.com
 
 tree:   git://git.infradead.org/linux-ubifs.git master
 head:   675ed2cad7be2477dadb70ff77316d125ae85b6f
 commit: 4df38926f337ff4de49a8fb512aa4a55df0c502d [18/23] UBI: block: Avoid 
 disk size integer overflow
 :: branch date: 34 minutes ago
 :: commit date: 3 days ago
 
 drivers/mtd/ubi/block.c:508 ubiblock_resize() error: potentially 
 dereferencing uninitialized 'dev'.
 
 git remote add ubifs git://git.infradead.org/linux-ubifs.git
 git remote update ubifs
 git checkout 4df38926f337ff4de49a8fb512aa4a55df0c502d
 vim +/dev +508 drivers/mtd/ubi/block.c
 
 9d54c8a3 Ezequiel Garcia2014-02-25  492  
 9d54c8a3 Ezequiel Garcia2014-02-25  493   /* Flush pending work and stop 
 this workqueue */
 9d54c8a3 Ezequiel Garcia2014-02-25  494   destroy_workqueue(dev-wq);
 9d54c8a3 Ezequiel Garcia2014-02-25  495  
 9d54c8a3 Ezequiel Garcia2014-02-25  496   ubiblock_cleanup(dev);
 9d54c8a3 Ezequiel Garcia2014-02-25  497   mutex_unlock(dev-dev_mutex);
 9d54c8a3 Ezequiel Garcia2014-02-25  498   kfree(dev);
 9d54c8a3 Ezequiel Garcia2014-02-25  499   return 0;
 9d54c8a3 Ezequiel Garcia2014-02-25  500  }
 9d54c8a3 Ezequiel Garcia2014-02-25  501  
 495f2bf6 Ezequiel Garcia2014-05-05  502  static int 
 ubiblock_resize(struct ubi_volume_info *vi)
 9d54c8a3 Ezequiel Garcia2014-02-25  503  {
 9d54c8a3 Ezequiel Garcia2014-02-25  504   struct ubiblock *dev;
 4df38926 Richard Weinberger 2014-05-05  505   u64 disk_capacity = 
 ((u64)vi-size * vi-usable_leb_size)  9;
 9d54c8a3 Ezequiel Garcia2014-02-25  506  
 4df38926 Richard Weinberger 2014-05-05  507   if ((sector_t)disk_capacity != 
 disk_capacity) {
 4df38926 Richard Weinberger 2014-05-05 @508   ubi_warn(%s: the 
 volume is too big, cannot resize (%d LEBs),
 4df38926 Richard Weinberger 2014-05-05  509
 dev-gd-disk_name, vi-size);
 4df38926 Richard Weinberger 2014-05-05  510   return -EFBIG;
 4df38926 Richard Weinberger 2014-05-05  511   }
 9d54c8a3 Ezequiel Garcia2014-02-25  512   /*
 9d54c8a3 Ezequiel Garcia2014-02-25  513* Need to lock the device list 
 until we stop using the device,
 4d283ee2 Artem Bityutskiy   2014-03-04  514* otherwise the device struct 
 might get released in
 4d283ee2 Artem Bityutskiy   2014-03-04  515* 'ubiblock_remove()'.
 9d54c8a3 Ezequiel Garcia2014-02-25  516*/
 
 ---
 0-DAY kernel build testing backend  Open Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [next:master 8911/10000] sound/soc/fsl/fsl_asrc.c:250 fsl_asrc_config_pair() warn: variable dereferenced before check 'config' (see line 243)

2014-08-01 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   5c159783e8086645dd7aa42e35c531ad0e8dd16d
commit: 3117bb3109dc223e186302f5dc8ce9ed04adca90 [8911/1] ASoC: fsl_asrc: 
Add ASRC ASoC CPU DAI and platform drivers

sound/soc/fsl/fsl_asrc.c:250 fsl_asrc_config_pair() warn: variable dereferenced 
before check 'config' (see line 243)
sound/soc/fsl/fsl_asrc_dma.c:304 fsl_asrc_dma_shutdown() warn: variable 
dereferenced before check 'pair' (see line 302)

git remote add next 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout 3117bb3109dc223e186302f5dc8ce9ed04adca90
vim +/config +250 sound/soc/fsl/fsl_asrc.c

3117bb31 Nicolin Chen 2014-07-29  237   */
3117bb31 Nicolin Chen 2014-07-29  238  static int fsl_asrc_config_pair(struct 
fsl_asrc_pair *pair)
3117bb31 Nicolin Chen 2014-07-29  239  {
3117bb31 Nicolin Chen 2014-07-29  240   struct asrc_config *config = 
pair-config;
3117bb31 Nicolin Chen 2014-07-29  241   struct fsl_asrc *asrc_priv = 
pair-asrc_priv;
3117bb31 Nicolin Chen 2014-07-29  242   enum asrc_pair_index index = 
pair-index;
3117bb31 Nicolin Chen 2014-07-29 @243   u32 inrate = config-input_sample_rate, 
indiv;
3117bb31 Nicolin Chen 2014-07-29  244   u32 outrate = 
config-output_sample_rate, outdiv;
3117bb31 Nicolin Chen 2014-07-29  245   bool ideal = config-inclk == 
INCLK_NONE;
3117bb31 Nicolin Chen 2014-07-29  246   u32 clk_index[2], div[2];
3117bb31 Nicolin Chen 2014-07-29  247   int in, out, channels;
3117bb31 Nicolin Chen 2014-07-29  248   struct clk *clk;
3117bb31 Nicolin Chen 2014-07-29  249  
3117bb31 Nicolin Chen 2014-07-29 @250   if (!config) {
3117bb31 Nicolin Chen 2014-07-29  251   pair_err(invalid pair 
config\n);
3117bb31 Nicolin Chen 2014-07-29  252   return -EINVAL;
3117bb31 Nicolin Chen 2014-07-29  253   }

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [net-next:master 1495/1511] drivers/net/ethernet/intel/i40e/i40e_fcoe.c:268 i40e_fcoe_ddp_put() warn: variable dereferenced before check 'fcoe' (see line 266)

2014-08-04 Thread Dan Carpenter
On Mon, Aug 04, 2014 at 10:05:53PM +, Dev, Vasu wrote:
 
 
  -Original Message-
  From: Dan Carpenter [mailto:dan.carpen...@oracle.com]
  Sent: Monday, August 04, 2014 1:37 AM
  To: kbu...@01.org; Dev, Vasu
  Cc: Brown, Aaron F; Dan Carpenter
  Subject: [net-next:master 1495/1511]
  drivers/net/ethernet/intel/i40e/i40e_fcoe.c:268 i40e_fcoe_ddp_put() warn:
  variable dereferenced before check 'fcoe' (see line 266)
  
  tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
  master
  head:   bae2e81a69c3f0e93707b36a5a655ca0e365a78d
  commit: 38758f552dc31e7f79671635ee0979b6e5e3bbed [1495/1511] i40e:
  adds FCoE to build and updates its documentation
  
  drivers/net/ethernet/intel/i40e/i40e_fcoe.c:529
  i40e_fcoe_dma_pool_create() error: we previously assumed 'ddp_pool'
  could be null (see line 518)
  
 
 Yeah missed this smatch catch,  can I fix this in a follow up another patch  ?
 


It's already in Dave's tree so it needs a new, separate fix-it patch.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [iio:testing 5/11] drivers/iio/industrialio-buffer.c:954 iio_buffer_add_demux() error: not allocating enough data 20 vs 4

2014-08-07 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head:   889c558095e96312d81b4084567c11a52b285393
commit: cbe88bcc8ec2f7d6739ea67d7c91517139f0a491 [5/11] iio: buffer: Coalesce 
adjacent demux table entries

drivers/iio/industrialio-buffer.c:954 iio_buffer_add_demux() error: not 
allocating enough data 20 vs 4

git remote add iio git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git remote update iio
git checkout cbe88bcc8ec2f7d6739ea67d7c91517139f0a491
vim +954 drivers/iio/industrialio-buffer.c

84b36ce5 Jonathan Cameron   2012-06-30  938 return ret;
84b36ce5 Jonathan Cameron   2012-06-30  939 }
84b36ce5 Jonathan Cameron   2012-06-30  940  
84b36ce5 Jonathan Cameron   2012-06-30  941 return 0;
84b36ce5 Jonathan Cameron   2012-06-30  942  }
84b36ce5 Jonathan Cameron   2012-06-30  943  
EXPORT_SYMBOL_GPL(iio_push_to_buffers);
84b36ce5 Jonathan Cameron   2012-06-30  944  
cbe88bcc Lars-Peter Clausen 2014-07-17  945  static int 
iio_buffer_add_demux(struct iio_buffer *buffer,
cbe88bcc Lars-Peter Clausen 2014-07-17  946 struct iio_demux_table **p, 
unsigned int in_loc, unsigned int out_loc,
cbe88bcc Lars-Peter Clausen 2014-07-17  947 unsigned int length)
cbe88bcc Lars-Peter Clausen 2014-07-17  948  {
cbe88bcc Lars-Peter Clausen 2014-07-17  949  
cbe88bcc Lars-Peter Clausen 2014-07-17  950 if (*p  (*p)-from + 
(*p)-length == in_loc 
cbe88bcc Lars-Peter Clausen 2014-07-17  951 (*p)-to + (*p)-length 
== out_loc) {
cbe88bcc Lars-Peter Clausen 2014-07-17  952 (*p)-length += length;
cbe88bcc Lars-Peter Clausen 2014-07-17  953 } else {
cbe88bcc Lars-Peter Clausen 2014-07-17 @954 *p = 
kmalloc(sizeof(*p), GFP_KERNEL);
cbe88bcc Lars-Peter Clausen 2014-07-17  955 if (*p == NULL)
cbe88bcc Lars-Peter Clausen 2014-07-17  956 return -ENOMEM;
cbe88bcc Lars-Peter Clausen 2014-07-17  957 (*p)-from = in_loc;
cbe88bcc Lars-Peter Clausen 2014-07-17  958 (*p)-to = out_loc;
cbe88bcc Lars-Peter Clausen 2014-07-17  959 (*p)-length = length;
cbe88bcc Lars-Peter Clausen 2014-07-17  960 list_add_tail((*p)-l, 
buffer-demux_list);
cbe88bcc Lars-Peter Clausen 2014-07-17  961 }
cbe88bcc Lars-Peter Clausen 2014-07-17  962  

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [ath6kl:ath-next-test 32/40] drivers/net/wireless/ath/ath10k/pci.c:380 ath10k_pci_rx_replenish() warn: mod_timer() takes an absolute time not an offset.

2014-08-13 Thread Dan Carpenter
tree:   git://github.com/kvalo/ath ath-next-test
head:   e63c7722823dee72ffa92864ed91d40fd0b99e7b
commit: c791269b6b9e8ae262be6483a0e5b4625060474f [32/40] ath10k: rework posting 
pci rx buffers

drivers/net/wireless/ath/ath10k/pci.c:380 ath10k_pci_rx_replenish() warn: 
mod_timer() takes an absolute time not an offset.

git remote add ath6kl git://github.com/kvalo/ath
git remote update ath6kl
git checkout c791269b6b9e8ae262be6483a0e5b4625060474f
vim +380 drivers/net/wireless/ath/ath10k/pci.c

c791269b6 Michal Kazior 2014-08-12  364 return ret;
c791269b6 Michal Kazior 2014-08-12  365  }
c791269b6 Michal Kazior 2014-08-12  366  
c791269b6 Michal Kazior 2014-08-12  367  static void 
ath10k_pci_rx_replenish(struct ath10k_pci_pipe *pipe)
c791269b6 Michal Kazior 2014-08-12  368  {
c791269b6 Michal Kazior 2014-08-12  369 struct ath10k *ar = 
pipe-hif_ce_state;
c791269b6 Michal Kazior 2014-08-12  370 struct ath10k_pci *ar_pci = 
ath10k_pci_priv(ar);
c791269b6 Michal Kazior 2014-08-12  371 int ret;
c791269b6 Michal Kazior 2014-08-12  372  
c791269b6 Michal Kazior 2014-08-12  373 spin_lock_bh(ar_pci-ce_lock);
c791269b6 Michal Kazior 2014-08-12  374 ret = 
__ath10k_pci_rx_post_pipe(pipe);
c791269b6 Michal Kazior 2014-08-12  375 
spin_unlock_bh(ar_pci-ce_lock);
c791269b6 Michal Kazior 2014-08-12  376  
c791269b6 Michal Kazior 2014-08-12  377 if (ret) {
c791269b6 Michal Kazior 2014-08-12  378 ath10k_warn(failed to 
replenish pci rx pipe %d: %d, arming retry timer\n,
c791269b6 Michal Kazior 2014-08-12  379 
pipe-pipe_num, ret);
c791269b6 Michal Kazior 2014-08-12 @380 
mod_timer(ar_pci-rx_replenish_retry,
c791269b6 Michal Kazior 2014-08-12  381   
ATH10K_PCI_RX_REPLENISH_RETRY_MS);
c791269b6 Michal Kazior 2014-08-12  382 }
c791269b6 Michal Kazior 2014-08-12  383  }
c791269b6 Michal Kazior 2014-08-12  384  
c791269b6 Michal Kazior 2014-08-12  385  static void 
ath10k_pci_rx_replenish_retry(unsigned long ptr)
c791269b6 Michal Kazior 2014-08-12  386  {
c791269b6 Michal Kazior 2014-08-12  387 struct ath10k *ar = (void *)ptr;
c791269b6 Michal Kazior 2014-08-12  388 struct ath10k_pci *ar_pci = 
ath10k_pci_priv(ar);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [drm-intel:topic/core-stuff 10/17] drivers/gpu/drm/drm_modeset_lock.c:84 __drm_modeset_lock_all() warn: possible memory leak of 'ctx'

2014-08-13 Thread Dan Carpenter
tree:   git://anongit.freedesktop.org/drm-intel topic/core-stuff
head:   b35a82dbefb67f733eb4aec91d0ecf72f5539129
commit: cb597bb3a2fbfc871cc1c703fb330d247bd21394 [10/17] drm: trylock modest 
locking for fbdev panics

drivers/gpu/drm/drm_modeset_lock.c:84 __drm_modeset_lock_all() warn: possible 
memory leak of 'ctx'

git remote add drm-intel git://anongit.freedesktop.org/drm-intel
git remote update drm-intel
git checkout cb597bb3a2fbfc871cc1c703fb330d247bd21394
vim +/ctx +84 drivers/gpu/drm/drm_modeset_lock.c

cb597bb3 Daniel Vetter 2014-07-27  68   * 0 on success or negative error code 
on failure.
a6a8bb84 Daniel Vetter 2014-07-25  69   */
cb597bb3 Daniel Vetter 2014-07-27  70  int __drm_modeset_lock_all(struct 
drm_device *dev,
cb597bb3 Daniel Vetter 2014-07-27  71  bool trylock)
a6a8bb84 Daniel Vetter 2014-07-25  72  {
a6a8bb84 Daniel Vetter 2014-07-25  73   struct drm_mode_config *config = 
dev-mode_config;
a6a8bb84 Daniel Vetter 2014-07-25  74   struct drm_modeset_acquire_ctx *ctx;
a6a8bb84 Daniel Vetter 2014-07-25  75   int ret;
a6a8bb84 Daniel Vetter 2014-07-25  76  
cb597bb3 Daniel Vetter 2014-07-27  77   ctx = kzalloc(sizeof(*ctx),
cb597bb3 Daniel Vetter 2014-07-27  78 trylock ? GFP_ATOMIC : 
GFP_KERNEL);
cb597bb3 Daniel Vetter 2014-07-27  79   if (!ctx)
cb597bb3 Daniel Vetter 2014-07-27  80   return -ENOMEM;
a6a8bb84 Daniel Vetter 2014-07-25  81  
cb597bb3 Daniel Vetter 2014-07-27  82   if (trylock) {
cb597bb3 Daniel Vetter 2014-07-27  83   if 
(!mutex_trylock(config-mutex))
cb597bb3 Daniel Vetter 2014-07-27 @84   return -EBUSY;
cb597bb3 Daniel Vetter 2014-07-27  85   } else {
cb597bb3 Daniel Vetter 2014-07-27  86   mutex_lock(config-mutex);
cb597bb3 Daniel Vetter 2014-07-27  87   }
a6a8bb84 Daniel Vetter 2014-07-25  88  
a6a8bb84 Daniel Vetter 2014-07-25  89   drm_modeset_acquire_init(ctx, 0);
cb597bb3 Daniel Vetter 2014-07-27  90   ctx-trylock_only = trylock;
a6a8bb84 Daniel Vetter 2014-07-25  91  
a6a8bb84 Daniel Vetter 2014-07-25  92  retry:

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [next:master 12185/12354] drivers/platform/x86/ideapad-laptop.c:459:13: sparse: duplicate const

2014-08-16 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   0c6cb5aa41fb3be49a7fc9dd39c695e392650e56
commit: 8f98742556ba706a176100b9705bc6b989fbd695 [12185/12354] ideapad-laptop: 
Constify DMI table and other r/o variables
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

 drivers/platform/x86/ideapad-laptop.c:459:13: sparse: duplicate const 
   drivers/platform/x86/ideapad-laptop.c:459:37: sparse: symbol 
'ideapad_rfk_data' was not declared. Should it be static?

git remote add next 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout 8f98742556ba706a176100b9705bc6b989fbd695
vim +459 drivers/platform/x86/ideapad-laptop.c

a84511f7 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-06-30  443  
8f987425 drivers/platform/x86/ideapad-laptop.c Mathias Krause  2014-07-16  444  
static const struct attribute_group ideapad_attribute_group = {
a84511f7 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-06-30  445  
.is_visible = ideapad_is_visible,
3371f481 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-06-30  446  
.attrs = ideapad_attributes
3371f481 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-06-30  447  
};
3371f481 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-06-30  448  
a4b5a279 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  449  
/*
a4b5a279 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  450  
 * Rfkill
a4b5a279 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  451  
 */
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  452  
struct ideapad_rfk_data {
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  453  
char *name;
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  454  
int cfgbit;
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  455  
int opcode;
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  456  
int type;
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  457  
};
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  458  
8f987425 drivers/platform/x86/ideapad-laptop.c Mathias Krause  2014-07-16 @459  
const const struct ideapad_rfk_data ideapad_rfk_data[] = {
2be1dc21 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-09-06  460  
{ ideapad_wlan,CFG_WIFI_BIT, VPCCMD_W_WIFI, RFKILL_TYPE_WLAN },
2be1dc21 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-09-06  461  
{ ideapad_bluetooth, CFG_BT_BIT, VPCCMD_W_BT, RFKILL_TYPE_BLUETOOTH },
2be1dc21 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2011-09-06  462  
{ ideapad_3g,CFG_3G_BIT, VPCCMD_W_3G, RFKILL_TYPE_WWAN },
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  463  
};
c1f73658 drivers/platform/x86/ideapad-laptop.c Ike Panhc   2010-12-13  464  
58ac7aa0 drivers/platform/x86/ideapad_acpi.c   David Woodhouse 2010-08-10  465  
static int ideapad_rfk_set(void *data, bool blocked)
58ac7aa0 drivers/platform/x86/ideapad_acpi.c   David Woodhouse 2010-08-10  466  
{
331e0ea2 drivers/platform/x86/ideapad-laptop.c Zhang Rui   2013-09-25  467  
struct ideapad_rfk_priv *priv = data;

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [next:master 980/1325] drivers/staging/lustre/lustre/mdc/mdc_locks.c:866 mdc_enqueue() error: potentially dereferencing uninitialized 'req'.

2014-08-18 Thread Dan Carpenter
[ This one is my bad.  I said that req didn't need to be initialized
  but it does.  Sorry.  -dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f68f82364938548b58b51d4b926642b0a3cf4c27
commit: ab909585b813193bb45f52367c1e7d056e33cfa9 [980/1325] staging: lustre: 
Cleanup variable declarations in mdc_enqueue()

New smatch warnings:
drivers/staging/lustre/lustre/mdc/mdc_locks.c:866 mdc_enqueue() error: 
potentially dereferencing uninitialized 'req'.

Old smatch warnings:
drivers/staging/lustre/lustre/mdc/mdc_locks.c:866 mdc_enqueue() error: we 
previously assumed 'req' could be null (see line 860)
drivers/staging/lustre/lustre/mdc/../include/lustre_mdc.h:116 
mdc_get_rpc_lock() warn: inconsistent returns mutex:lck-rpcl_mutex: locked 
(116) unlocked (86, 101)

git remote add next 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout ab909585b813193bb45f52367c1e7d056e33cfa9
vim +/req +866 drivers/staging/lustre/lustre/mdc/mdc_locks.c

e93a3082 Andrew Perepechko  2014-02-09  850 } else if (it-it_op  
IT_GETXATTR) {
7fc1f831 Andrew Perepechko  2013-12-03  851 req = 
mdc_intent_getxattr_pack(exp, it, op_data);
d7e09d03 Peng Tao   2013-05-02  852 } else {
d7e09d03 Peng Tao   2013-05-02  853 LBUG();
0a3bdb00 Greg Kroah-Hartman 2013-08-03  854 return -EINVAL;
d7e09d03 Peng Tao   2013-05-02  855 }
d7e09d03 Peng Tao   2013-05-02  856  
d7e09d03 Peng Tao   2013-05-02  857 if (IS_ERR(req))
0a3bdb00 Greg Kroah-Hartman 2013-08-03  858 return PTR_ERR(req);
d7e09d03 Peng Tao   2013-05-02  859  
d7e09d03 Peng Tao   2013-05-02  860 if (req != NULL  it  
it-it_op  IT_CREAT)
d7e09d03 Peng Tao   2013-05-02  861 /* ask ptlrpc not to 
resend on EINPROGRESS since we have our own
d7e09d03 Peng Tao   2013-05-02  862  * retry logic */
d7e09d03 Peng Tao   2013-05-02  863 
req-rq_no_retry_einprogress = 1;
d7e09d03 Peng Tao   2013-05-02  864  
d7e09d03 Peng Tao   2013-05-02  865 if (resends) {
d7e09d03 Peng Tao   2013-05-02 @866 req-rq_generation_set 
= 1;
d7e09d03 Peng Tao   2013-05-02  867 
req-rq_import_generation = generation;
7264b8a5 Greg Kroah-Hartman 2014-07-12  868 req-rq_sent = 
get_seconds() + resends;
d7e09d03 Peng Tao   2013-05-02  869 }
d7e09d03 Peng Tao   2013-05-02  870  
d7e09d03 Peng Tao   2013-05-02  871 /* It is important to obtain 
rpc_lock first (if applicable), so that
d7e09d03 Peng Tao   2013-05-02  872  * threads that are serialised 
with rpc_lock are not polluting our
d7e09d03 Peng Tao   2013-05-02  873  * rpcs in flight counter. We 
do not do flock request limiting, though*/
d7e09d03 Peng Tao   2013-05-02  874 if (it) {

--
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [input:next 499/499] drivers/input/misc/drv260x.c:563 drv260x_probe() warn: was intended here instead of ||?

2014-08-19 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
head:   1d3e3ba4b51e309608c1eba680031007ba877826
commit: 1d3e3ba4b51e309608c1eba680031007ba877826 [499/499] Input: drv260x - add 
TI drv260x haptics driver

drivers/input/misc/drv260x.c:563 drv260x_probe() warn: was  intended here 
instead of ||?

git remote add input 
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
git remote update input
git checkout 1d3e3ba4b51e309608c1eba680031007ba877826
vim +563 drivers/input/misc/drv260x.c

1d3e3ba4 Dan Murphy 2014-08-17  547  
1d3e3ba4 Dan Murphy 2014-08-17  548 if (haptics-mode  DRV260X_LRA_MODE ||
1d3e3ba4 Dan Murphy 2014-08-17  549 haptics-mode  DRV260X_ERM_MODE) {
1d3e3ba4 Dan Murphy 2014-08-17  550 dev_err(client-dev,
1d3e3ba4 Dan Murphy 2014-08-17  551 Vibrator mode is 
invalid: %i\n,
1d3e3ba4 Dan Murphy 2014-08-17  552 haptics-mode);
1d3e3ba4 Dan Murphy 2014-08-17  553 return -EINVAL;
1d3e3ba4 Dan Murphy 2014-08-17  554 }
1d3e3ba4 Dan Murphy 2014-08-17  555  
1d3e3ba4 Dan Murphy 2014-08-17  556 if (haptics-library  
DRV260X_LIB_EMPTY ||
1d3e3ba4 Dan Murphy 2014-08-17  557 haptics-library  
DRV260X_ERM_LIB_F) {
1d3e3ba4 Dan Murphy 2014-08-17  558 dev_err(client-dev,
1d3e3ba4 Dan Murphy 2014-08-17  559 Library value is 
invalid: %i\n, haptics-library);
1d3e3ba4 Dan Murphy 2014-08-17  560 return -EINVAL;
1d3e3ba4 Dan Murphy 2014-08-17  561 }
1d3e3ba4 Dan Murphy 2014-08-17  562  
1d3e3ba4 Dan Murphy 2014-08-17 @563 if (haptics-mode == DRV260X_LRA_MODE 
1d3e3ba4 Dan Murphy 2014-08-17  564 (haptics-library != 
DRV260X_LIB_EMPTY ||
1d3e3ba4 Dan Murphy 2014-08-17  565  haptics-library != 
DRV260X_LIB_LRA)) {
1d3e3ba4 Dan Murphy 2014-08-17  566 dev_err(client-dev,
1d3e3ba4 Dan Murphy 2014-08-17  567 LRA Mode with ERM 
Library mismatch\n);
1d3e3ba4 Dan Murphy 2014-08-17  568 return -EINVAL;
1d3e3ba4 Dan Murphy 2014-08-17  569 }
1d3e3ba4 Dan Murphy 2014-08-17  570  
1d3e3ba4 Dan Murphy 2014-08-17  571 haptics-regulator = 
devm_regulator_get(client-dev, vbat);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [socfpga-nex:master-ltc-regulator 4/10] drivers/tty/newhaven_lcd.c:145:36-37: WARNING: Use ARRAY_SIZE

2014-08-25 Thread Dan Carpenter
On Sun, Aug 24, 2014 at 09:47:40AM +0200, Julia Lawall wrote:
 Both look reasonable.
 

The attachments were lost.  I've attached them.

The missing NULL terminator seems especially important.

regards,
dan carpenter

From: Fengguang Wu fengguang...@intel.com
Subject: [PATCH] fix coccinelle warnings
TO: Alan Tull at...@opensource.altera.com
CC: Alan Tull at...@opensource.altera.com
CC: linux-ker...@vger.kernel.org 
CC: devicet...@vger.kernel.org 

drivers/tty/newhaven_lcd.c:606:49-50: lcd_of_match is not NULL terminated at line 606

 Make sure of_device_id tables are NULL terminated
Generated by: scripts/coccinelle/misc/of_table.cocci

CC: Alan Tull at...@opensource.altera.com
Signed-off-by: Fengguang Wu fengguang...@intel.com
---

Please take the patch only if it's a positive warning. Thanks!

 newhaven_lcd.c |1 +
 1 file changed, 1 insertion(+)

--- a/drivers/tty/newhaven_lcd.c
+++ b/drivers/tty/newhaven_lcd.c
@@ -604,6 +604,7 @@ static int __exit lcd_remove(struct i2c_
 
 static const struct of_device_id lcd_of_match[] = {
 	{ .compatible = newhaven,nhd-0216k3z-nsw-bbw, },
+	{},
 };
 
 static const struct i2c_device_id lcd_id[] = {
From: Fengguang Wu fengguang...@intel.com
Subject: [PATCH] fix coccinelle warnings
TO: Alan Tull at...@opensource.altera.com
CC: Alan Tull at...@opensource.altera.com
CC: linux-ker...@vger.kernel.org 
CC: devicet...@vger.kernel.org 

drivers/tty/newhaven_lcd.c:145:36-37: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

Generated by: scripts/coccinelle/misc/array_size.cocci

CC: Alan Tull at...@opensource.altera.com
Signed-off-by: Fengguang Wu fengguang...@intel.com
---

Please take the patch only if it's a positive warning. Thanks!

 newhaven_lcd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/newhaven_lcd.c
+++ b/drivers/tty/newhaven_lcd.c
@@ -142,7 +142,7 @@ static int lcd_load_custom_fonts(struct
 	u8 buf[LCD_BYTES_PER_FONT_CMD];
 	int count, i;
 
-	for (i = 0; i  sizeof(custom_fonts) / sizeof(struct custom_font) ; i++) {
+	for (i = 0; i  ARRAY_SIZE(custom_fonts); i++) {
 		buf[0] = LCD_COMMAND;
 		buf[1] = LCD_CUSTOM_CHAR;
 		buf[2] = custom_fonts[i].mapping;
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 1/47] drivers/net/hyperv/netvsc.c:1108 netvsc_device_add() error: we previously assumed 'net_device' could be null (see line 1057)

2014-08-26 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   a3d1214688d5259a200414def4d38f1e4531febd
commit: f90251c8a6d06ed8b072a2a0f13c4b8a6d0cb222 [1/47] hyperv: Increase the 
buffer length for netvsc_channel_cb()

drivers/net/hyperv/netvsc.c:1108 netvsc_device_add() error: we previously 
assumed 'net_device' could be null (see line 1057)

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout f90251c8a6d06ed8b072a2a0f13c4b8a6d0cb222
vim +/net_device +1108 drivers/net/hyperv/netvsc.c

aae23986 drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-05-12  1051  
int ring_size =
aae23986 drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-05-12  1052  
((struct netvsc_device_info *)additional_info)-ring_size;
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1053  
struct netvsc_device *net_device;
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1054  
struct net_device *ndev;
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1055  
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1056  
net_device = alloc_net_device(device);
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21 @1057  
if (!net_device) {
ace163a8 drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-08-25  1058  
ret = -ENOMEM;
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1059  
goto cleanup;
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1060  
}
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1061  
5b54dac8 drivers/net/hyperv/netvsc.c Haiyang Zhang2014-04-21  1062  
net_device-ring_size = ring_size;
5b54dac8 drivers/net/hyperv/netvsc.c Haiyang Zhang2014-04-21  1063  
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1064  
/*
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1065  
 * Coming into this function, struct net_device * is
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1066  
 * registered as the driver private data.
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1067  
 * In alloc_net_device(), we register struct netvsc_device *
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1068  
 * as the driver private data and stash away struct net_device *
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1069  
 * in struct netvsc_device *.
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1070  
 */
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1071  
ndev = net_device-ndev;
2ddd5e5f drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-09-13  1072  
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1073  
/* Initialize the NetVSC channel extension */
35abb21a drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-05-10  1074  
init_completion(net_device-channel_init_wait);
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1075  
5b54dac8 drivers/net/hyperv/netvsc.c Haiyang Zhang2014-04-21  1076  
set_per_channel_state(device-channel, net_device-cb_buffer);
5b54dac8 drivers/net/hyperv/netvsc.c Haiyang Zhang2014-04-21  1077  
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1078  
/* Open the channel */
aae23986 drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-05-12  1079  
ret = vmbus_open(device-channel, ring_size * PAGE_SIZE,
aae23986 drivers/staging/hv/netvsc.c K. Y. Srinivasan 2011-05-12  1080  
 ring_size * PAGE_SIZE, NULL, 0,
5b54dac8 drivers/net/hyperv/netvsc.c Haiyang Zhang2014-04-21  1081  
 netvsc_channel_cb, device-channel);
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1082  
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1083  
if (ret != 0) {
d9871158 drivers/staging/hv/netvsc.c Haiyang Zhang2011-09-01  1084  
netdev_err(ndev, unable to open channel: %d\n, ret);
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1085  
goto cleanup;
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1086  
}
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1087  
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1088  
/* Channel is opened */
c909ebbd drivers/staging/hv/netvsc.c Haiyang Zhang2011-09-01  1089  
pr_info(hv_netvsc channel opened successfully\n);
b637e023 drivers/staging/hv/netvsc.c Haiyang Zhang2011-04-21  1090  
5b54dac8 drivers/net/hyperv/netvsc.c Haiyang Zhang2014-04-21  1091  
net_device-chn_table[0] = device-channel;
5b54dac8 drivers/net/hyperv/netvsc.c Haiyang 

[kbuild] [drm-intel:drm-intel-next-queued 177/195] drivers/gpu/drm/i915/i915_gpu_error.c:1031 i915_gem_record_rings() error: we previously assumed 'request-ctx' could be null (see line 992)

2014-08-27 Thread Dan Carpenter
tree:   git://anongit.freedesktop.org/drm-intel drm-intel-next-queued
head:   c1f7ab8c9a7b09f4ed6499904298ddf1c67b1764
commit: 4ecbdf4dfc537cd9ed53b4cb77e0c48dd6daa620 [177/195] drm/i915/bdw: Make 
sure error capture keeps working with Execlists

drivers/gpu/drm/i915/i915_gpu_error.c:1031 i915_gem_record_rings() error: we 
previously assumed 'request-ctx' could be null (see line 992)

git remote add drm-intel git://anongit.freedesktop.org/drm-intel
git remote update drm-intel
git checkout 4ecbdf4dfc537cd9ed53b4cb77e0c48dd6daa620
vim +1031 drivers/gpu/drm/i915/i915_gpu_error.c

0ca36d78 Ben Widawsky  2014-06-30   986 
i915_record_ring_state(dev, error, ring, error-ring[i]);
84734a04 Mika Kuoppala 2013-07-12   987  
ab0e7ff9 Chris Wilson  2014-02-25   988 request = 
i915_gem_find_active_request(ring);
ab0e7ff9 Chris Wilson  2014-02-25   989 if (request) {
ae6c4806 Daniel Vetter 2014-08-06   990 struct 
i915_address_space *vm;
ae6c4806 Daniel Vetter 2014-08-06   991  
ae6c4806 Daniel Vetter 2014-08-06  @992 vm = 
request-ctx  request-ctx-ppgtt ?
ae6c4806 Daniel Vetter 2014-08-06   993 
request-ctx-ppgtt-base :
ae6c4806 Daniel Vetter 2014-08-06   994 
dev_priv-gtt.base;
ae6c4806 Daniel Vetter 2014-08-06   995  
ab0e7ff9 Chris Wilson  2014-02-25   996 /* We need to 
copy these to an anonymous buffer
ab0e7ff9 Chris Wilson  2014-02-25   997  * as the 
simplest method to avoid being overwritten
ab0e7ff9 Chris Wilson  2014-02-25   998  * by userspace.
ab0e7ff9 Chris Wilson  2014-02-25   999  */
84734a04 Mika Kuoppala 2013-07-12  1000 
error-ring[i].batchbuffer =
ab0e7ff9 Chris Wilson  2014-02-25  1001 
i915_error_object_create(dev_priv,
ab0e7ff9 Chris Wilson  2014-02-25  1002 
 request-batch_obj,
ae6c4806 Daniel Vetter 2014-08-06  1003 
 vm);
ab0e7ff9 Chris Wilson  2014-02-25  1004  
448caa7d Chris Wilson  2014-08-12  1005 if 
(HAS_BROKEN_CS_TLB(dev_priv-dev))
ab0e7ff9 Chris Wilson  2014-02-25  1006 
error-ring[i].wa_batchbuffer =
ab0e7ff9 Chris Wilson  2014-02-25  1007 
i915_error_ggtt_object_create(dev_priv,
ab0e7ff9 Chris Wilson  2014-02-25  1008 
 ring-scratch.obj);
ab0e7ff9 Chris Wilson  2014-02-25  1009  
ab0e7ff9 Chris Wilson  2014-02-25  1010 if 
(request-file_priv) {
ab0e7ff9 Chris Wilson  2014-02-25  1011 struct 
task_struct *task;
ab0e7ff9 Chris Wilson  2014-02-25  1012  
ab0e7ff9 Chris Wilson  2014-02-25  1013 
rcu_read_lock();
ab0e7ff9 Chris Wilson  2014-02-25  1014 task = 
pid_task(request-file_priv-file-pid,
ab0e7ff9 Chris Wilson  2014-02-25  1015 
PIDTYPE_PID);
ab0e7ff9 Chris Wilson  2014-02-25  1016 if 
(task) {
ab0e7ff9 Chris Wilson  2014-02-25  1017 
strcpy(error-ring[i].comm, task-comm);
ab0e7ff9 Chris Wilson  2014-02-25  1018 
error-ring[i].pid = task-pid;
ab0e7ff9 Chris Wilson  2014-02-25  1019 }
ab0e7ff9 Chris Wilson  2014-02-25  1020 
rcu_read_unlock();
ab0e7ff9 Chris Wilson  2014-02-25  1021 }
ab0e7ff9 Chris Wilson  2014-02-25  1022 }
84734a04 Mika Kuoppala 2013-07-12  1023  
4ecbdf4d Oscar Mateo   2014-07-24  1024 if 
(i915.enable_execlists) {
4ecbdf4d Oscar Mateo   2014-07-24  1025 /* TODO: This 
is only a small fix to keep basic error
4ecbdf4d Oscar Mateo   2014-07-24  1026  * capture 
working, but we need to add more information
4ecbdf4d Oscar Mateo   2014-07-24  1027  * for it to be 
useful (e.g. dump the context being
4ecbdf4d Oscar Mateo   2014-07-24  1028  * executed).
4ecbdf4d Oscar Mateo   2014-07-24  1029  */
4ecbdf4d Oscar Mateo   2014-07-24  1030 if (request)
4ecbdf4d Oscar Mateo   2014-07-24 @1031 rbuf = 
request-ctx-engine[ring-id].ringbuf;
4ecbdf4d Oscar Mateo   2014-07-24  1032 else
4ecbdf4d Oscar Mateo   2014-07-24  1033 rbuf = 
ring-default_context-engine[ring-id].ringbuf;
4ecbdf4d Oscar Mateo   2014-07-24  1034 } else

---
0-DAY kernel build testing backend  

[kbuild] [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?

2014-08-27 Thread Dan Carpenter

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d05446ae2128064a4bb8f74c84f6901ffb5c94bc
commit: 802d335c0f7f1a1867bf59814c55970a71b10413 [2131/2422] prctl: PR_SET_MM 
-- introduce PR_SET_MM_MAP operation

kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the 
bytes remaining?

git remote add next 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout 802d335c0f7f1a1867bf59814c55970a71b10413
vim +1888 kernel/sys.c

802d335c Cyrill Gorcunov 2014-08-26  1872  
802d335c Cyrill Gorcunov 2014-08-26  1873   mm-start_code  = 
prctl_map.start_code;
802d335c Cyrill Gorcunov 2014-08-26  1874   mm-end_code= 
prctl_map.end_code;
802d335c Cyrill Gorcunov 2014-08-26  1875   mm-start_data  = 
prctl_map.start_data;
802d335c Cyrill Gorcunov 2014-08-26  1876   mm-end_data= 
prctl_map.end_data;
802d335c Cyrill Gorcunov 2014-08-26  1877   mm-start_brk   = 
prctl_map.start_brk;
802d335c Cyrill Gorcunov 2014-08-26  1878   mm-brk = prctl_map.brk;
802d335c Cyrill Gorcunov 2014-08-26  1879   mm-start_stack = 
prctl_map.start_stack;
802d335c Cyrill Gorcunov 2014-08-26  1880   mm-arg_start   = 
prctl_map.arg_start;
802d335c Cyrill Gorcunov 2014-08-26  1881   mm-arg_end = 
prctl_map.arg_end;
802d335c Cyrill Gorcunov 2014-08-26  1882   mm-env_start   = 
prctl_map.env_start;
802d335c Cyrill Gorcunov 2014-08-26  1883   mm-env_end = 
prctl_map.env_end;
802d335c Cyrill Gorcunov 2014-08-26  1884  
802d335c Cyrill Gorcunov 2014-08-26  1885   error = 0;
802d335c Cyrill Gorcunov 2014-08-26  1886  out:
802d335c Cyrill Gorcunov 2014-08-26  1887   up_read(mm-mmap_sem);
802d335c Cyrill Gorcunov 2014-08-26 @1888   return error;
802d335c Cyrill Gorcunov 2014-08-26  1889  }
802d335c Cyrill Gorcunov 2014-08-26  1890  #endif /* CONFIG_CHECKPOINT_RESTORE 
*/
802d335c Cyrill Gorcunov 2014-08-26  1891  
028ee4be Cyrill Gorcunov 2012-01-12  1892  static int prctl_set_mm(int opt, 
unsigned long addr,
028ee4be Cyrill Gorcunov 2012-01-12  1893   unsigned long 
arg4, unsigned long arg5)
028ee4be Cyrill Gorcunov 2012-01-12  1894  {
028ee4be Cyrill Gorcunov 2012-01-12  1895   struct mm_struct *mm = 
current-mm;
fe8c7f5c Cyrill Gorcunov 2012-05-31  1896   struct vm_area_struct *vma;

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 2131/2422] kernel/sys.c:1888 prctl_set_mm_map() warn: maybe return -EFAULT instead of the bytes remaining?

2014-08-27 Thread Dan Carpenter
On Wed, Aug 27, 2014 at 02:09:09PM +0400, Cyrill Gorcunov wrote:

 Not really sure I'm follow. @error is error code either 0 (on success) or
 any other if some problem happened.


It's complaining about this:

kernel/sys.c
  1846  if (prctl_map.auxv_size) {
  1847  up_read(mm-mmap_sem);
  1848  memset(user_auxv, 0, sizeof(user_auxv));
  1849  error = copy_from_user(user_auxv,
  1850 (const void __user 
*)prctl_map.auxv,
  1851 prctl_map.auxv_size);
  1852  down_read(mm-mmap_sem);
  1853  if (error)
  1854  goto out;
  1855  }

It should say:

if (error) {
error = -EFAULT;
goto out;
}

regards,
dan carpenter
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [wireless-next:master 78/80] drivers/net/wireless/ath/ath9k/channel.c:362 ath_chanctx_event() error: we previously assumed 'vif' could be null (see line 315)

2014-08-28 Thread Dan Carpenter

tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   6a5d088a923854569e20eac4f3f569926d5911ec
commit: 878066e745b54578409ea765cfc718fcd99a4802 [78/80] ath9k: Add more debug 
statements for channel context

New smatch warnings:
drivers/net/wireless/ath/ath9k/channel.c:362 ath_chanctx_event() error: we 
previously assumed 'vif' could be null (see line 315)

git remote add wireless-next 
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git
git remote update wireless-next
git checkout 878066e745b54578409ea765cfc718fcd99a4802
vim +/vif +362 drivers/net/wireless/ath/ath9k/channel.c

3ae07d39 Felix Fietkau2014-06-11  309   struct ath_vif *avp = NULL;
73fa2f26 Felix Fietkau2014-06-11  310   struct ath_chanctx *ctx;
748299f2 Felix Fietkau2014-06-11  311   u32 tsf_time;
ec70abe1 Felix Fietkau2014-06-11  312   u32 beacon_int;
3ae07d39 Felix Fietkau2014-06-11  313   bool noa_changed = false;
3ae07d39 Felix Fietkau2014-06-11  314  
3ae07d39 Felix Fietkau2014-06-11 @315   if (vif)
3ae07d39 Felix Fietkau2014-06-11  316   avp = (struct ath_vif 
*) vif-drv_priv;
748299f2 Felix Fietkau2014-06-11  317  
748299f2 Felix Fietkau2014-06-11  318   spin_lock_bh(sc-chan_lock);
748299f2 Felix Fietkau2014-06-11  319  
878066e7 Sujith Manoharan 2014-08-27  320   ath_dbg(common, CHAN_CTX, 
cur_chan: %d MHz, event: %s, state: %s\n,
878066e7 Sujith Manoharan 2014-08-27  321   
sc-cur_chan-chandef.center_freq1,
878066e7 Sujith Manoharan 2014-08-27  322   
chanctx_event_string(ev),
878066e7 Sujith Manoharan 2014-08-27  323   
chanctx_state_string(sc-sched.state));
878066e7 Sujith Manoharan 2014-08-27  324  
748299f2 Felix Fietkau2014-06-11  325   switch (ev) {
748299f2 Felix Fietkau2014-06-11  326   case 
ATH_CHANCTX_EVENT_BEACON_PREPARE:
3ae07d39 Felix Fietkau2014-06-11  327   if 
(avp-offchannel_duration)
3ae07d39 Felix Fietkau2014-06-11  328   
avp-offchannel_duration = 0;
3ae07d39 Felix Fietkau2014-06-11  329  
878066e7 Sujith Manoharan 2014-08-27  330   if (avp-chanctx != 
sc-cur_chan) {
878066e7 Sujith Manoharan 2014-08-27  331   ath_dbg(common, 
CHAN_CTX,
878066e7 Sujith Manoharan 2014-08-27  332   
Contexts differ, not preparing beacon\n);
73fa2f26 Felix Fietkau2014-06-11  333   break;
878066e7 Sujith Manoharan 2014-08-27  334   }
73fa2f26 Felix Fietkau2014-06-11  335  
73fa2f26 Felix Fietkau2014-06-11  336   if 
(sc-sched.offchannel_pending) {
73fa2f26 Felix Fietkau2014-06-11  337   
sc-sched.offchannel_pending = false;
73fa2f26 Felix Fietkau2014-06-11  338   sc-next_chan = 
sc-offchannel.chan;
73fa2f26 Felix Fietkau2014-06-11  339   sc-sched.state 
= ATH_CHANCTX_STATE_WAIT_FOR_BEACON;
878066e7 Sujith Manoharan 2014-08-27  340   ath_dbg(common, 
CHAN_CTX,
878066e7 Sujith Manoharan 2014-08-27  341   
Setting offchannel_pending to false\n);
73fa2f26 Felix Fietkau2014-06-11  342   }
73fa2f26 Felix Fietkau2014-06-11  343  
73fa2f26 Felix Fietkau2014-06-11  344   ctx = 
ath_chanctx_get_next(sc, sc-cur_chan);
73fa2f26 Felix Fietkau2014-06-11  345   if (ctx-active  
sc-sched.state == ATH_CHANCTX_STATE_IDLE) {
73fa2f26 Felix Fietkau2014-06-11  346   sc-next_chan = 
ctx;
73fa2f26 Felix Fietkau2014-06-11  347   sc-sched.state 
= ATH_CHANCTX_STATE_WAIT_FOR_BEACON;
878066e7 Sujith Manoharan 2014-08-27  348   ath_dbg(common, 
CHAN_CTX,
878066e7 Sujith Manoharan 2014-08-27  349   Set 
next context, move chanctx state to WAIT_FOR_BEACON\n);
73fa2f26 Felix Fietkau2014-06-11  350   }
73fa2f26 Felix Fietkau2014-06-11  351  
73fa2f26 Felix Fietkau2014-06-11  352   /* if the timer missed 
its window, use the next interval */
878066e7 Sujith Manoharan 2014-08-27  353   if (sc-sched.state == 
ATH_CHANCTX_STATE_WAIT_FOR_TIMER) {
73fa2f26 Felix Fietkau2014-06-11  354   sc-sched.state 
= ATH_CHANCTX_STATE_WAIT_FOR_BEACON;
878066e7 Sujith Manoharan 2014-08-27  355   ath_dbg(common, 
CHAN_CTX,
878066e7 Sujith Manoharan 2014-08-27  356   Move 
chanctx state from WAIT_FOR_TIMER to WAIT_FOR_BEACON\n);
878066e7 Sujith Manoharan 2014-08-27  357   }
73fa2f26 Felix Fietkau2014-06-11  358  
748299f2 Felix Fietkau2014-06-11  359   if (sc-sched.state != 
ATH_CHANCTX_STATE_WAIT_FOR_BEACON)
748299f2 Felix Fietkau2014-06-11  360   break;
748299f2 Felix Fietkau2014-06-11  

[kbuild] [block:for-3.18/core 4/16] fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 31))) = (0-2147483647, 18446744071562067968-u64max == 2147483648)'

2014-08-28 Thread Dan Carpenter
[ Huh...  This is an odd one.  At first I thought it was a bug in Smatch
  and then I wondered why Fengguang's scripts blame Martin but it turns
  out the tools are correct.

  Adding __REQ_INTEGRITY means that rw can never equal KERNEL_READ
  because the negative INT_MIN gets sign expanded to 0x8000
  which is not equal to 1  31.  -dan ]

tree:   git://git.kernel.dk/linux-block.git for-3.18/core
head:   073deb5787aca4569a184a1c541d251f34c9c0a9
commit: 7128b3ac3b84b4f80d77e94c1c221a68334904f6 [4/16] block: Replace 
bi_integrity with bi_special

fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 
 31))) = (0-2147483647,18446744071562067968-u64max == 2147483648)'

git remote add block git://git.kernel.dk/linux-block.git
git remote update block
git checkout 7128b3ac3b84b4f80d77e94c1c221a68334904f6
vim +225 fs/nfs/direct.c

b8a32e2b8 Chuck Lever2006-03-20  209   *
b8a32e2b8 Chuck Lever2006-03-20  210   * The presence of this routine in 
the address space ops vector means
a564b8f03 Mel Gorman 2012-07-31  211   * the NFS client supports direct 
I/O. However, for most direct IO, we
a564b8f03 Mel Gorman 2012-07-31  212   * shunt off direct read and write 
requests before the VFS gets them,
a564b8f03 Mel Gorman 2012-07-31  213   * so this method is only ever called 
for swap.
^1da177e4 Linus Torvalds 2005-04-16  214   */
d8d3d94b8 Al Viro2014-03-04  215  ssize_t nfs_direct_IO(int rw, struct 
kiocb *iocb, struct iov_iter *iter, loff_t pos)
b8a32e2b8 Chuck Lever2006-03-20  216  {
a564b8f03 Mel Gorman 2012-07-31  217  #ifndef CONFIG_NFS_SWAP
6de1472f1 Al Viro2013-09-16  218dprintk(NFS: nfs_direct_IO 
(%pD) off/no(%Ld/%lu) EINVAL\n,
d8d3d94b8 Al Viro2014-03-04  219iocb-ki_filp, 
(long long) pos, iter-nr_segs);
b8a32e2b8 Chuck Lever2006-03-20  220  
b8a32e2b8 Chuck Lever2006-03-20  221return -EINVAL;
a564b8f03 Mel Gorman 2012-07-31  222  #else
a564b8f03 Mel Gorman 2012-07-31  223VM_BUG_ON(iocb-ki_nbytes != 
PAGE_SIZE);
a564b8f03 Mel Gorman 2012-07-31  224  
a564b8f03 Mel Gorman 2012-07-31 @225if (rw == READ || rw == 
KERNEL_READ)
619d30b4b Al Viro2014-03-04  226return 
nfs_file_direct_read(iocb, iter, pos,
a564b8f03 Mel Gorman 2012-07-31  227rw == 
READ ? true : false);
619d30b4b Al Viro2014-03-04  228return 
nfs_file_direct_write(iocb, iter, pos,
a564b8f03 Mel Gorman 2012-07-31  229rw == 
WRITE ? true : false);
a564b8f03 Mel Gorman 2012-07-31  230  #endif /* CONFIG_NFS_SWAP */
b8a32e2b8 Chuck Lever2006-03-20  231  }
b8a32e2b8 Chuck Lever2006-03-20  232  
749e146e0 Chuck Lever2007-05-19  233  static void 
nfs_direct_release_pages(struct page **pages, unsigned int npages)

:: The code at line 225 was first introduced by commit
:: a564b8f0398636ba30b07c0eaebdef7ff7837249 nfs: enable swap on NFS

:: TO: Mel Gorman mgor...@suse.de
:: CC: Linus Torvalds torva...@linux-foundation.org

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [block:for-3.18/core 11/17] drivers/scsi/sd_dif.c:277 sd_dif_config_host() warn: variable dereferenced before check 'sdkp' (see line 242)

2014-08-28 Thread Dan Carpenter
tree:   git://git.kernel.dk/linux-block.git for-3.18/core
head:   b96dc4f1418142bff3cb037dc11ec5ffa390a9b3
commit: 4c600ab779694eea6eee16478df41ab50437518e [11/17] block: Add a disk flag 
to block integrity profile

drivers/scsi/sd_dif.c:277 sd_dif_config_host() warn: variable dereferenced 
before check 'sdkp' (see line 242)

git remote add block git://git.kernel.dk/linux-block.git
git remote update block
git checkout 4c600ab779694eea6eee16478df41ab50437518e
vim +/sdkp +277 drivers/scsi/sd_dif.c

af55ff67 Martin K. Petersen 2008-07-17  236  
af55ff67 Martin K. Petersen 2008-07-17  237  /*
af55ff67 Martin K. Petersen 2008-07-17  238   * Configure exchange of 
protection information between OS and HBA.
af55ff67 Martin K. Petersen 2008-07-17  239   */
af55ff67 Martin K. Petersen 2008-07-17  240  void sd_dif_config_host(struct 
scsi_disk *sdkp)
af55ff67 Martin K. Petersen 2008-07-17  241  {
af55ff67 Martin K. Petersen 2008-07-17 @242 struct scsi_device *sdp = 
sdkp-device;
af55ff67 Martin K. Petersen 2008-07-17  243 struct gendisk *disk = 
sdkp-disk;
af55ff67 Martin K. Petersen 2008-07-17  244 u8 type = sdkp-protection_type;
9e06688e Martin K. Petersen 2008-09-19  245 int dif, dix;
af55ff67 Martin K. Petersen 2008-07-17  246  
9e06688e Martin K. Petersen 2008-09-19  247 dif = 
scsi_host_dif_capable(sdp-host, type);
9e06688e Martin K. Petersen 2008-09-19  248 dix = 
scsi_host_dix_capable(sdp-host, type);
af55ff67 Martin K. Petersen 2008-07-17  249  
9e06688e Martin K. Petersen 2008-09-19  250 if (!dix  
scsi_host_dix_capable(sdp-host, 0)) {
9e06688e Martin K. Petersen 2008-09-19  251 dif = 0; dix = 1;
af55ff67 Martin K. Petersen 2008-07-17  252 }
af55ff67 Martin K. Petersen 2008-07-17  253  
9e06688e Martin K. Petersen 2008-09-19  254 if (!dix)
af55ff67 Martin K. Petersen 2008-07-17  255 return;
af55ff67 Martin K. Petersen 2008-07-17  256  
af55ff67 Martin K. Petersen 2008-07-17  257 /* Enable DMA of protection 
information */
af55ff67 Martin K. Petersen 2008-07-17  258 if 
(scsi_host_get_guard(sdkp-device-host)  SHOST_DIX_GUARD_IP)
af55ff67 Martin K. Petersen 2008-07-17  259 if (type == 
SD_DIF_TYPE3_PROTECTION)
af55ff67 Martin K. Petersen 2008-07-17  260 
blk_integrity_register(disk, dif_type3_integrity_ip);
af55ff67 Martin K. Petersen 2008-07-17  261 else
af55ff67 Martin K. Petersen 2008-07-17  262 
blk_integrity_register(disk, dif_type1_integrity_ip);
af55ff67 Martin K. Petersen 2008-07-17  263 else
af55ff67 Martin K. Petersen 2008-07-17  264 if (type == 
SD_DIF_TYPE3_PROTECTION)
af55ff67 Martin K. Petersen 2008-07-17  265 
blk_integrity_register(disk, dif_type3_integrity_crc);
af55ff67 Martin K. Petersen 2008-07-17  266 else
af55ff67 Martin K. Petersen 2008-07-17  267 
blk_integrity_register(disk, dif_type1_integrity_crc);
af55ff67 Martin K. Petersen 2008-07-17  268  
cbdc1445 Martin K. Petersen 2008-10-01  269 sd_printk(KERN_NOTICE, sdkp,
9e06688e Martin K. Petersen 2008-09-19  270   Enabling DIX %s 
protection\n, disk-integrity-name);
af55ff67 Martin K. Petersen 2008-07-17  271  
af55ff67 Martin K. Petersen 2008-07-17  272 /* Signal to block layer that 
we support sector tagging */
4c600ab7 Martin K. Petersen 2014-08-28  273 if (dif  type) {
4c600ab7 Martin K. Petersen 2014-08-28  274  
4c600ab7 Martin K. Petersen 2014-08-28  275 disk-integrity-flags 
|= BLK_INTEGRITY_DEVICE_CAPABLE;
4c600ab7 Martin K. Petersen 2014-08-28  276  
4c600ab7 Martin K. Petersen 2014-08-28 @277 if (!sdkp)
4c600ab7 Martin K. Petersen 2014-08-28  278 return;
4c600ab7 Martin K. Petersen 2014-08-28  279  
af55ff67 Martin K. Petersen 2008-07-17  280 if (type == 
SD_DIF_TYPE3_PROTECTION)

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [block:for-3.18/core 4/16] fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw == (0 | (1 31))) = (0-2147483647, 18446744071562067968-u64max == 2147483648)'

2014-08-29 Thread Dan Carpenter
On Fri, Aug 29, 2014 at 10:59:08AM -0400, Martin K. Petersen wrote:
  Dan == Dan Carpenter dan.carpen...@oracle.com writes:
 
 Dan [ Huh...  This is an odd one.  At first I thought it was a bug in
 Dan Smatch and then I wondered why Fengguang's scripts blame Martin but
 Dan it turns out the tools are correct.
 
 Dan Adding __REQ_INTEGRITY means that rw can never equal
 Dan KERNEL_READ because the negative INT_MIN gets sign expanded to
 Dan 0x8000 which is not equal to 1  31.  -dan ]
 
 Dan fs/nfs/direct.c:225 nfs_direct_IO() warn: impossible condition '(rw
 Dan == (0 | (1  31))) = (0-2147483647,18446744071562067968-u64max ==
 Dan 2147483648)'
 
 Interesting. I guess the extra flag pushed it over the edge.
 
 rw should really be an unsigned long.

It should be u64 so 32 bit system still work.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [staging:staging-next 284/325] drivers/staging/bcm/Bcmchar.c:961 bcm_char_ioctl_buffer_download_start() warn: inconsistent returns sem:ad-NVMRdmWrmLock: locked (943 [(-16)]) unlocked (9

2014-09-01 Thread Dan Carpenter
Not a new warning.  Just renaming the locks.

regards,
dan carpenter


On Sun, Aug 31, 2014 at 04:15:36AM +0800, kbuild test robot wrote:
 TO: Matthias Beyer m...@beyermatthias.de
 CC: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
 staging-next
 head:   86128a0dd6c691f6356c9fb81e1ade5d4ff89ea8
 commit: 11d37b1f36c83e80267630c9856eb205b7426e0b [284/325] Staging: bcm: 
 Bcmchar.c: Renamed variable: Adapter - ad
 :: branch date: 7 minutes ago
 :: commit date: 14 minutes ago
 
 New smatch warnings:
 drivers/staging/bcm/Bcmchar.c:961 bcm_char_ioctl_buffer_download_start() 
 warn: inconsistent returns sem:ad-NVMRdmWrmLock: locked (943 [(-16)]) 
 unlocked (935 [(-13)], 956 [s32min-(-1),1-s32max], 961 [0])
 drivers/staging/bcm/Bcmchar.c:983 bcm_char_ioctl_buffer_download() error: 
 double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:991 bcm_char_ioctl_buffer_download() error: 
 double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:997 bcm_char_ioctl_buffer_download() error: 
 double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1003 bcm_char_ioctl_buffer_download() error: 
 double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1014 bcm_char_ioctl_buffer_download() error: 
 double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1041 bcm_char_ioctl_buffer_download() error: 
 double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1063 bcm_char_ioctl_buffer_download_stop() 
 error: double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1079 bcm_char_ioctl_buffer_download_stop() 
 error: double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1116 bcm_char_ioctl_buffer_download_stop() 
 error: double unlock 'sem:ad-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1596 bcm_char_ioctl_nvm_rw() warn: inconsistent 
 returns sem:ad-NVMRdmWrmLock: locked (1570 [s32min-(-1),1-s32max]) unlocked 
 (1504 [(-14)], 1514 [(-1)], 1520 [(-14)], 1526 [(-14)], 1532 [(-1)], 1536 
 [(-1)], 1541 [(-4095)-(-1)], 1548 [s32min-(-1),1-s32max], 1561 [(-13)], 1585 
 [s32min-(-1),1-s32max], 1596 [0])
 
 Old smatch warnings:
 drivers/staging/bcm/Bcmchar.c:2367 bcm_char_ioctl() warn: bitwise AND 
 condition is false here
 
 git remote add staging 
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
 git remote update staging
 git checkout 11d37b1f36c83e80267630c9856eb205b7426e0b
 vim +961 drivers/staging/bcm/Bcmchar.c
 
 11d37b1f Matthias Beyer 2014-08-27   955  up(ad-NVMRdmWrmLock);
 79f99494 Dave Jones 2014-02-13   956  return Status;
 79f99494 Dave Jones 2014-02-13   957  }
 79f99494 Dave Jones 2014-02-13   958  mdelay(10);
 79f99494 Dave Jones 2014-02-13   959  
 11d37b1f Matthias Beyer 2014-08-27   960  up(ad-NVMRdmWrmLock);
 79f99494 Dave Jones 2014-02-13  @961  return Status;
 79f99494 Dave Jones 2014-02-13   962  }
 79f99494 Dave Jones 2014-02-13   963  
 18e26b35 Ebru Akagunduz 2014-03-13   964  static int 
 bcm_char_ioctl_buffer_download(void __user *argp,
 11d37b1f Matthias Beyer 2014-08-27   965  
   struct bcm_mini_adapter *ad)
 d9db71bd Dave Jones 2014-02-13   966  {
 d9db71bd Dave Jones 2014-02-13   967  struct bcm_firmware_info 
 *psFwInfo = NULL;
 d9db71bd Dave Jones 2014-02-13   968  struct bcm_ioctl_buffer 
 IoBuffer;
 d9db71bd Dave Jones 2014-02-13   969  INT Status;
 d9db71bd Dave Jones 2014-02-13   970  
 11d37b1f Matthias Beyer 2014-08-27   971  BCM_DEBUG_PRINT(ad, 
 DBG_TYPE_PRINTK, 0, 0,
 18e26b35 Ebru Akagunduz 2014-03-13   972  Starting the firmware 
 download PID =0x%x\n, current-pid);
 d9db71bd Dave Jones 2014-02-13   973  
 11d37b1f Matthias Beyer 2014-08-27   974  if 
 (!down_trylock(ad-fw_download_sema)) {
 11d37b1f Matthias Beyer 2014-08-27   975  BCM_DEBUG_PRINT(ad, 
 DBG_TYPE_PRINTK, 0, 0,
 d9db71bd Dave Jones 2014-02-13   976  
 Invalid way to download buffer. Use Start and then call this!!!\n);
 11d37b1f Matthias Beyer 2014-08-27   977  
 up(ad-fw_download_sema);
 d9db71bd Dave Jones 2014-02-13   978  return -EINVAL;
 d9db71bd Dave Jones 2014-02-13   979  }
 d9db71bd Dave Jones 2014-02-13   980  
 d9db71bd Dave Jones 2014-02-13   981  /* Copy Ioctl Buffer structure 
 */
 d9db71bd Dave Jones 2014-02-13   982  if (copy_from_user(IoBuffer, 
 argp, sizeof(struct bcm_ioctl_buffer))) {
 11d37b1f Matthias Beyer 2014-08-27  @983  
 up(ad-fw_download_sema);
 d9db71bd Dave Jones 2014-02-13   984  return -EFAULT;
 d9db71bd Dave Jones 2014-02-13   985  }
 d9db71bd Dave Jones 2014-02-13   986  
 11d37b1f Matthias Beyer 2014-08-27   987  BCM_DEBUG_PRINT(ad, 
 DBG_TYPE_PRINTK, 0, 0,
 d9db71bd

[kbuild] [staging:staging-next 461/473] drivers/staging/vt6655/device_main.c:1023 device_free_info() warn: variable dereferenced before check 'pDevice' (see line 1021)

2014-09-01 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-next
head:   f25884839e7e8de72b3c0da518900f5915b7c4b1
commit: 70afb8e5037a97d7294955531395b65e225c98e1 [461/473] staging: vt6655: 
remove multiple instances of driver loading.

New smatch warnings:
drivers/staging/vt6655/device_main.c:1023 device_free_info() warn: variable 
dereferenced before check 'pDevice' (see line 1021)

Old smatch warnings:
drivers/staging/vt6655/device_main.c:1771 device_dma0_xmit() error: 
__builtin_memcpy() 'pDevice-sTxEthHeader.abyDstAddr' too small (6 vs 14)
drivers/staging/vt6655/device_main.c:1962 device_xmit() error: 
__builtin_memcpy() 'pDevice-sTxEthHeader.abyDstAddr' too small (6 vs 14)
drivers/staging/vt6655/device_main.c:2137 device_xmit() error: we previously 
assumed 'pTransmitKey' could be null (see line 2041)
drivers/staging/vt6655/device_main.c:2523 Config_FileOperation() warn: 
returning -1 instead of -ENOMEM is sloppy
drivers/staging/vt6655/device_main.c:2821 device_ioctl() warn: check that 
'range' doesn't leak information (struct has a hole after 'num_bitrates')

git remote add staging 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git remote update staging
git checkout 70afb8e5037a97d7294955531395b65e225c98e1
vim +/pDevice +1023 drivers/staging/vt6655/device_main.c

5449c685 Forest Bond   2009-04-25  1015  
1b12068a Charles Clément   2010-08-01  1016 return true;
5449c685 Forest Bond   2009-04-25  1017  }
5449c685 Forest Bond   2009-04-25  1018  
3f8597f4 Malcolm Priestley 2014-08-10  1019  static void 
device_free_info(struct vnt_private *pDevice)
84b50762 Guillaume Clement 2014-07-25  1020  {
5449c685 Forest Bond   2009-04-25 @1021 struct net_device *dev = 
pDevice-dev;
5449c685 Forest Bond   2009-04-25  1022  
70afb8e5 Malcolm Priestley 2014-08-21 @1023 if (!pDevice)
70afb8e5 Malcolm Priestley 2014-08-21  1024 return;
70afb8e5 Malcolm Priestley 2014-08-21  1025  
5449c685 Forest Bond   2009-04-25  1026 ASSERT(pDevice);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [kees:lsm/stacking 4/4] security/smack/smack_lsm.c:457 smack_sb_kern_mount() error: potentially dereferencing uninitialized 'isp'.

2014-09-03 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git 
lsm/stacking
head:   a1811bedacca7afc4f41741401eeaa003d22d6bb
commit: a1811bedacca7afc4f41741401eeaa003d22d6bb [4/4] LSM: Stop allocating 
inode-i_security

security/smack/smack_lsm.c:457 smack_sb_kern_mount() error: potentially 
dereferencing uninitialized 'isp'.

git remote add kees git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git
git remote update kees
git checkout a1811bedacca7afc4f41741401eeaa003d22d6bb
vim +/isp +457 security/smack/smack_lsm.c

24ea1b6e Casey Schaufler 2013-12-30  441 */
24ea1b6e Casey Schaufler 2013-12-30  442skp = smk_of_current();
24ea1b6e Casey Schaufler 2013-12-30  443sp-smk_root = 
skp-smk_known;
24ea1b6e Casey Schaufler 2013-12-30  444sp-smk_default = 
skp-smk_known;
24ea1b6e Casey Schaufler 2013-12-30  445}
e114e473 Casey Schaufler 2008-02-04  446/*
e114e473 Casey Schaufler 2008-02-04  447 * Initialize the root inode.
e114e473 Casey Schaufler 2008-02-04  448 */
a1811bed Casey Schaufler 2014-08-08  449if (!(inode-i_smack.smk_flags 
 SMK_INODE_ALLOCATED))
a1811bed Casey Schaufler 2014-08-08  450/*
a1811bed Casey Schaufler 2014-08-08  451 * Don't optimize this. 
The desired result is that flags be
a1811bed Casey Schaufler 2014-08-08  452 * cleared except for 
the ALLOCATED bit.
a1811bed Casey Schaufler 2014-08-08  453 */
a1811bed Casey Schaufler 2014-08-08  454
inode-i_smack.smk_flags = SMK_INODE_ALLOCATED;
e114e473 Casey Schaufler 2008-02-04  455  
e830b394 Casey Schaufler 2013-05-22  456if (transmute)
e830b394 Casey Schaufler 2013-05-22 @457isp-smk_flags |= 
SMK_INODE_TRANSMUTE;
e830b394 Casey Schaufler 2013-05-22  458  
e114e473 Casey Schaufler 2008-02-04  459return 0;
e114e473 Casey Schaufler 2008-02-04  460  }
e114e473 Casey Schaufler 2008-02-04  461  
e114e473 Casey Schaufler 2008-02-04  462  /**
e114e473 Casey Schaufler 2008-02-04  463   * smack_sb_statfs - Smack check on 
statfs
e114e473 Casey Schaufler 2008-02-04  464   * @dentry: identifies the file 
system in question
e114e473 Casey Schaufler 2008-02-04  465   *

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [sound-unstable:master 15036/15056] sound/core/pcm_native.c:806 snd_pcm_action_mutex() error: double unlock 'mutex:substream-self_group.mutex'

2014-09-03 Thread Dan Carpenter
[ It's not immediately clear to me that we intended to drop the lock if
  someone else is holding it.  If so maybe this should have a comment?
  -dan ]


tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git 
master
head:   33a8b5de23c78c47e2e0791118e836e75f3e175a
commit: 32f5bd4b2e7724019b2330358e0f0e05b2ed8e79 [15036/15056] ALSA: pcm: Allow 
nonatomic trigger operations

New smatch warnings:
sound/core/pcm_native.c:806 snd_pcm_action_mutex() error: double unlock 
'mutex:substream-self_group.mutex'

git remote add sound-unstable 
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-unstable.git
git remote update sound-unstable
git checkout 32f5bd4b2e7724019b2330358e0f0e05b2ed8e79
vim +806 sound/core/pcm_native.c

^1da177e Linus Torvalds 2005-04-16  790 if (res == 0)
^1da177e Linus Torvalds 2005-04-16  791 
ops-post_action(substream, state);
^1da177e Linus Torvalds 2005-04-16  792 else if (ops-undo_action)
^1da177e Linus Torvalds 2005-04-16  793 
ops-undo_action(substream, state);
^1da177e Linus Torvalds 2005-04-16  794 return res;
^1da177e Linus Torvalds 2005-04-16  795  }
^1da177e Linus Torvalds 2005-04-16  796  
32f5bd4b Takashi Iwai   2014-08-29  797  /* call in mutex-protected context */
32f5bd4b Takashi Iwai   2014-08-29  798  static int snd_pcm_action_mutex(struct 
action_ops *ops,
32f5bd4b Takashi Iwai   2014-08-29  799 struct 
snd_pcm_substream *substream,
32f5bd4b Takashi Iwai   2014-08-29  800 int 
state)
32f5bd4b Takashi Iwai   2014-08-29  801  {
32f5bd4b Takashi Iwai   2014-08-29  802 int res;
32f5bd4b Takashi Iwai   2014-08-29  803  
32f5bd4b Takashi Iwai   2014-08-29  804 if 
(snd_pcm_stream_linked(substream)) {
32f5bd4b Takashi Iwai   2014-08-29  805 if 
(!mutex_trylock(substream-self_group.mutex)) {
32f5bd4b Takashi Iwai   2014-08-29 @806 
mutex_unlock(substream-self_group.mutex);
32f5bd4b Takashi Iwai   2014-08-29  807 
mutex_lock(substream-group-mutex);
32f5bd4b Takashi Iwai   2014-08-29  808 
mutex_lock(substream-self_group.mutex);
32f5bd4b Takashi Iwai   2014-08-29  809 }
32f5bd4b Takashi Iwai   2014-08-29  810 res = 
snd_pcm_action_group(ops, substream, state, 1);
32f5bd4b Takashi Iwai   2014-08-29  811 
mutex_unlock(substream-group-mutex);
32f5bd4b Takashi Iwai   2014-08-29  812 } else {
32f5bd4b Takashi Iwai   2014-08-29  813 res = 
snd_pcm_action_single(ops, substream, state);
32f5bd4b Takashi Iwai   2014-08-29  814 }

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [jlayton:locks-3.19 44/47] fs/cifs/file.c:1198 cifs_push_posix_locks() warn: inconsistent returns spin_lock:inode-i_lock: locked (1192 [s32min-s32max]) unlocked (1192 [0])

2014-09-04 Thread Dan Carpenter
[ It looks like a stray spin_unlock(inode-i_lock); was left behind by
  mistake.  -dan ]

tree:   git://git.samba.org/jlayton/linux locks-3.19
head:   d9212689e0732acf5a0b94083c1319ee4f396a15
commit: 35c20cc874547c97d0c5abd315caef5bb52c056b [44/47] cifs: convert it to 
use file_lock_context

New smatch warnings:
fs/cifs/file.c:1198 cifs_push_posix_locks() warn: inconsistent returns 
spin_lock:inode-i_lock: locked (1192 [s32min-s32max]) unlocked (1192 [0])

Old smatch warnings:
fs/cifs/file.c:3181 cifs_read() warn: variable dereferenced before check 
'tcon-ses' (see line 3166)

git remote add jlayton git://git.samba.org/jlayton/linux
git remote update jlayton
git checkout 35c20cc874547c97d0c5abd315caef5bb52c056b
vim +1198 fs/cifs/file.c

c5fd363d Jeff Layton 2012-07-23  1182   
 lck-offset, lck-length, NULL,
4f6bcec9 Pavel Shilovsky 2011-10-22  1183   
 lck-type, 0);
4f6bcec9 Pavel Shilovsky 2011-10-22  1184   if (stored_rc)
4f6bcec9 Pavel Shilovsky 2011-10-22  1185   rc = stored_rc;
4f6bcec9 Pavel Shilovsky 2011-10-22  1186   list_del(lck-llist);
4f6bcec9 Pavel Shilovsky 2011-10-22  1187   kfree(lck);
4f6bcec9 Pavel Shilovsky 2011-10-22  1188   }
4f6bcec9 Pavel Shilovsky 2011-10-22  1189  
d5751469 Pavel Shilovsky 2012-03-05  1190  out:
6d5786a3 Pavel Shilovsky 2012-06-20  1191   free_xid(xid);
4f6bcec9 Pavel Shilovsky 2011-10-22  1192   return rc;
d5751469 Pavel Shilovsky 2012-03-05  1193  err_out:
d5751469 Pavel Shilovsky 2012-03-05  1194   list_for_each_entry_safe(lck, 
tmp, locks_to_send, llist) {
d5751469 Pavel Shilovsky 2012-03-05  1195   list_del(lck-llist);
d5751469 Pavel Shilovsky 2012-03-05  1196   kfree(lck);
d5751469 Pavel Shilovsky 2012-03-05  1197   }
d5751469 Pavel Shilovsky 2012-03-05 @1198   goto out;
4f6bcec9 Pavel Shilovsky 2011-10-22  1199  }
4f6bcec9 Pavel Shilovsky 2011-10-22  1200  
4f6bcec9 Pavel Shilovsky 2011-10-22  1201  static int
b8db928b Pavel Shilovsky 2012-11-22  1202  cifs_push_locks(struct cifsFileInfo 
*cfile)
9ec3c882 Pavel Shilovsky 2012-11-22  1203  {
b8db928b Pavel Shilovsky 2012-11-22  1204   struct cifs_sb_info *cifs_sb = 
CIFS_SB(cfile-dentry-d_sb);
9ec3c882 Pavel Shilovsky 2012-11-22  1205   struct cifsInodeInfo *cinode = 
CIFS_I(cfile-dentry-d_inode);
b8db928b Pavel Shilovsky 2012-11-22  1206   struct cifs_tcon *tcon = 
tlink_tcon(cfile-tlink);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [bluetooth:master 75/78] net/bluetooth/smp.c:1182 smp_conn_security() warn: variable dereferenced before check 'conn' (see line 1174)

2014-09-05 Thread Dan Carpenter
tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
master
head:   2c87f4732acc5dc46a0b7e4e7529ca49804b97f1
commit: 473b6ffa78aa307b59612384b84cddf13ffa77b3 [75/78] Bluetooth: Fix locking 
of the SMP context

net/bluetooth/smp.c:1182 smp_conn_security() warn: variable dereferenced before 
check 'conn' (see line 1174)

git remote add bluetooth 
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
git remote update bluetooth
git checkout 473b6ffa78aa307b59612384b84cddf13ffa77b3
vim +/conn +1182 net/bluetooth/smp.c

da85e5e5 Vinicius Costa Gomes 2011-06-09  1168  return 0;
88ba43b6 Anderson Briglia 2011-06-09  1169  }
88ba43b6 Anderson Briglia 2011-06-09  1170  
cc110922 Vinicius Costa Gomes 2012-08-23  1171  int smp_conn_security(struct 
hci_conn *hcon, __u8 sec_level)
eb492e01 Anderson Briglia 2011-06-09  1172  {
cc110922 Vinicius Costa Gomes 2012-08-23  1173  struct l2cap_conn *conn 
= hcon-l2cap_data;
473b6ffa Johan Hedberg2014-09-05  1174  struct l2cap_chan *chan 
= conn-smp;
0a66cf20 Johan Hedberg2014-03-24  1175  struct smp_chan *smp;
2b64d153 Brian Gix2011-12-21  1176  __u8 authreq;
473b6ffa Johan Hedberg2014-09-05  1177  int ret;
eb492e01 Anderson Briglia 2011-06-09  1178  
3a0259bb Vinicius Costa Gomes 2011-06-09  1179  BT_DBG(conn %p hcon %p 
level 0x%2.2x, conn, hcon, sec_level);
3a0259bb Vinicius Costa Gomes 2011-06-09  1180  
0a66cf20 Johan Hedberg2014-03-24  1181  /* This may be NULL if 
there's an unexpected disconnection */
0a66cf20 Johan Hedberg2014-03-24  1182  if (!conn)
0a66cf20 Johan Hedberg2014-03-24  1183  return 1;
0a66cf20 Johan Hedberg2014-03-24  1184  
757aee0f Johan Hedberg2013-04-24  1185  if 
(!test_bit(HCI_LE_ENABLED, hcon-hdev-dev_flags))

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [regulator:topic/isl9305 5/5] drivers/regulator/isl9305.c:202 isl9305_i2c_probe() error: buffer overflow 'pdata-init_data' 3 = 3

2014-09-08 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 
topic/isl9305
head:   dec38b5ce6a9edb406c60c2670b26a1a4262fdb9
commit: dec38b5ce6a9edb406c60c2670b26a1a4262fdb9 [5/5] regulator: isl9305: Add 
Intersil ISL9305/H driver

drivers/regulator/isl9305.c:202 isl9305_i2c_probe() error: buffer overflow 
'pdata-init_data' 3 = 3

git remote add regulator 
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
git remote update regulator
git checkout dec38b5ce6a9edb406c60c2670b26a1a4262fdb9
vim +202 drivers/regulator/isl9305.c

dec38b5c Mark Brown 2014-09-06  186 dev_err(i2c-dev, Failed to 
create regmap: %d\n, ret);
dec38b5c Mark Brown 2014-09-06  187 return ret;
dec38b5c Mark Brown 2014-09-06  188 }
dec38b5c Mark Brown 2014-09-06  189  
dec38b5c Mark Brown 2014-09-06  190 config.dev = i2c-dev;
dec38b5c Mark Brown 2014-09-06  191  
dec38b5c Mark Brown 2014-09-06  192 for (i = 0; i  
ARRAY_SIZE(isl9305_regulators); i++) {
dec38b5c Mark Brown 2014-09-06  193 config.of_node = NULL;
dec38b5c Mark Brown 2014-09-06  194 config.init_data = NULL;
dec38b5c Mark Brown 2014-09-06  195  
dec38b5c Mark Brown 2014-09-06  196 if (of_matches) {
dec38b5c Mark Brown 2014-09-06  197 config.init_data = 
of_matches[i].init_data;
dec38b5c Mark Brown 2014-09-06  198 config.of_node = 
of_matches[i].of_node;
dec38b5c Mark Brown 2014-09-06  199 }
dec38b5c Mark Brown 2014-09-06  200  
dec38b5c Mark Brown 2014-09-06  201 if (!config.init_data  pdata)
dec38b5c Mark Brown 2014-09-06 @202 config.init_data = 
pdata-init_data[i];
dec38b5c Mark Brown 2014-09-06  203  
dec38b5c Mark Brown 2014-09-06  204 rdev = 
devm_regulator_register(i2c-dev,
dec38b5c Mark Brown 2014-09-06  205
isl9305_regulators[i],
dec38b5c Mark Brown 2014-09-06  206
config);
dec38b5c Mark Brown 2014-09-06  207 if (IS_ERR(rdev)) {
dec38b5c Mark Brown 2014-09-06  208 ret = PTR_ERR(rdev);
dec38b5c Mark Brown 2014-09-06  209 dev_err(i2c-dev, 
Failed to register %s: %d\n,
dec38b5c Mark Brown 2014-09-06  210 
isl9305_regulators[i].name, ret);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [regulator:topic/tps65217 1/1] drivers/regulator/tps65217-regulator.c:248 tps65217_regulator_probe() error: we previously assumed 'pdata' could be null (see line 243)

2014-09-08 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 
topic/tps65217
head:   81baf9fe0243a4450d738676ccf99d325460c748
commit: 81baf9fe0243a4450d738676ccf99d325460c748 [1/1] regulator: tps65217: 
Remove spurious platform data check

drivers/regulator/tps65217-regulator.c:248 tps65217_regulator_probe() error: we 
previously assumed 'pdata' could be null (see line 243)

git remote add regulator 
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
git remote update regulator
git checkout 81baf9fe0243a4450d738676ccf99d325460c748
vim +/pdata +248 drivers/regulator/tps65217-regulator.c

c172708d38 Mark Brown   2012-04-04  237  
1922b0f275 AnilKumar Ch 2012-08-13  238 platform_set_drvdata(pdev, tps);
a493077f18 AnilKumar Ch 2012-01-11  239  
1922b0f275 AnilKumar Ch 2012-08-13  240 for (i = 0; i  
TPS65217_NUM_REGULATOR; i++) {
1922b0f275 AnilKumar Ch 2012-08-13  241 /* Register the 
regulators */
1922b0f275 AnilKumar Ch 2012-08-13  242 config.dev = tps-dev;
81baf9fe02 Mark Brown   2014-09-06  243 if (pdata)
94ee607c96 Axel Lin 2014-02-21  244 
config.init_data = pdata-tps65217_init_data[i];
1922b0f275 AnilKumar Ch 2012-08-13  245 config.driver_data = 
tps;
1922b0f275 AnilKumar Ch 2012-08-13  246 config.regmap = 
tps-regmap;
1922b0f275 AnilKumar Ch 2012-08-13  247 if (tps-dev-of_node)
1922b0f275 AnilKumar Ch 2012-08-13  248 config.of_node 
= pdata-of_node[i];
1922b0f275 AnilKumar Ch 2012-08-13  249  
4aac198ddc Sachin Kamat 2013-09-04  250 rdev = 
devm_regulator_register(pdev-dev, regulators[i],
4aac198ddc Sachin Kamat 2013-09-04  251 
   config);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [nfc-next:master 42/43] drivers/nfc/trf7970a.c:876 trf7970a_irq() warn: inconsistent returns mutex:trf-lock: locked (836 [s32min-(-1), 1-s32max], 849 [s32min-(-1), 1-s32max]) unlocked (744

2014-09-08 Thread Dan Carpenter
[ The New Smatch warning format for this looks like:

  CHECK   drivers/nfc/trf7970a.c
drivers/nfc/trf7970a.c:810 trf7970a_irq() warn: passing zero to 'ERR_PTR'
drivers/nfc/trf7970a.c:876 trf7970a_irq() warn: inconsistent returns 
'mutex:trf-lock'.
  Locked on:   line 836
   line 849
  Unlocked on: line 744
   line 750
   line 758
   line 876
drivers/nfc/trf7970a.c:1663 trf7970a_tg_listen() warn: inconsistent returns 
'mutex:trf-lock'.
  Locked on:   line 1630
   line 1635
   line 1640
   line 1645
  Unlocked on: line 1663

 -dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git master
head:   cb174aba86fe10ddac8b692c90a9480526c02953
commit: 13b4272a8264220ec043a922fd1fa05da72d57ae [42/43] NFC: trf7970a: Add 
Target Mode Support

New smatch warnings:
drivers/nfc/trf7970a.c:876 trf7970a_irq() warn: inconsistent returns 
mutex:trf-lock: locked (836 [s32min-(-1),1-s32max], 849 
[s32min-(-1),1-s32max]) unlocked (744 [0], 750 [0], 758 [0], 876 [1])

Old smatch warnings:
drivers/nfc/trf7970a.c:1663 trf7970a_tg_listen() warn: inconsistent returns 
mutex:trf-lock: locked (1630 [s32min-(-1),1-s32max], 1635 
[s32min-(-1),1-s32max], 1640 [s32min-(-1),1-s32max], 1645 
[s32min-(-1),1-s32max]) unlocked (1663 [0], 1663 [s32min-(-1),1-s32max], 1663 
[(-12)], 1663 [(-125)], 1663 [(-5)])

git remote add nfc-next 
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git
git remote update nfc-next
git checkout 13b4272a8264220ec043a922fd1fa05da72d57ae
vim +876 drivers/nfc/trf7970a.c

9d9304b3 Mark A. Greer 2014-03-10  860  break;
13b4272a Mark A. Greer 2014-09-02  861  case TRF7970A_ST_LISTENING:
13b4272a Mark A. Greer 2014-09-02  862  if (status  
TRF7970A_IRQ_STATUS_SRX) {
13b4272a Mark A. Greer 2014-09-02  863  
trf-ignore_timeout =
13b4272a Mark A. Greer 2014-09-02  864  
!cancel_delayed_work(trf-timeout_work);
13b4272a Mark A. Greer 2014-09-02  865  
trf7970a_drain_fifo(trf, status);
13b4272a Mark A. Greer 2014-09-02  866  } else if (!(status  
TRF7970A_IRQ_STATUS_NFC_RF)) {
13b4272a Mark A. Greer 2014-09-02  867  
trf7970a_send_err_upstream(trf, -EIO);
13b4272a Mark A. Greer 2014-09-02  868  }
13b4272a Mark A. Greer 2014-09-02  869  break;
165063f1 Mark A. Greer 2014-03-10  870  default:
165063f1 Mark A. Greer 2014-03-10  871  dev_err(trf-dev, %s - 
Driver in invalid state: %d\n,
165063f1 Mark A. Greer 2014-03-10  872  
__func__, trf-state);
165063f1 Mark A. Greer 2014-03-10  873  }
165063f1 Mark A. Greer 2014-03-10  874  
165063f1 Mark A. Greer 2014-03-10  875  mutex_unlock(trf-lock);
165063f1 Mark A. Greer 2014-03-10 @876  return IRQ_HANDLED;
165063f1 Mark A. Greer 2014-03-10  877  }
165063f1 Mark A. Greer 2014-03-10  878  
9d9304b3 Mark A. Greer 2014-03-10  879  static void trf7970a_issue_eof(struct 
trf7970a *trf)
9d9304b3 Mark A. Greer 2014-03-10  880  {
9d9304b3 Mark A. Greer 2014-03-10  881  int ret;
9d9304b3 Mark A. Greer 2014-03-10  882  
9d9304b3 Mark A. Greer 2014-03-10  883  dev_dbg(trf-dev, Issuing 
EOF\n);
9d9304b3 Mark A. Greer 2014-03-10  884  

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [devfreq:for-chanwoo 1/5] drivers/devfreq/devfreq-event.c:85:1-7: preceding lock on line 57

2014-09-08 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq for-chanwoo
head:   3a85940e803da22f5fedc64871c5f065802057b5
commit: 52d1ab5e8580ce084c1c312e15a1025662d12c30 [1/5] devfreq: Add new 
devfreq_event class to provide basic data for devfreq governor

 drivers/devfreq/devfreq-event.c:85:1-7: preceding lock on line 57

git remote add devfreq git://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq
git remote update devfreq
git checkout 52d1ab5e8580ce084c1c312e15a1025662d12c30
vim +85 drivers/devfreq/devfreq-event.c

52d1ab5e Chanwoo Choi 2014-07-18  51return ERR_PTR(-EINVAL);
52d1ab5e Chanwoo Choi 2014-07-18  52  
52d1ab5e Chanwoo Choi 2014-07-18  53edev = kzalloc(sizeof(struct 
devfreq_event_dev), GFP_KERNEL);
52d1ab5e Chanwoo Choi 2014-07-18  54if (!edev)
52d1ab5e Chanwoo Choi 2014-07-18  55return ERR_PTR(-ENOMEM);
52d1ab5e Chanwoo Choi 2014-07-18  56  
52d1ab5e Chanwoo Choi 2014-07-18  57mutex_lock(devfreq_event_list_lock);
52d1ab5e Chanwoo Choi 2014-07-18  58  
52d1ab5e Chanwoo Choi 2014-07-18  59mutex_init(edev-mutex);
52d1ab5e Chanwoo Choi 2014-07-18  60edev-desc = desc;
52d1ab5e Chanwoo Choi 2014-07-18  61edev-driver_data = desc-driver_data;
52d1ab5e Chanwoo Choi 2014-07-18  62edev-owner = desc-owner;
52d1ab5e Chanwoo Choi 2014-07-18  63  
52d1ab5e Chanwoo Choi 2014-07-18  64edev-dev.parent = dev;
52d1ab5e Chanwoo Choi 2014-07-18  65edev-dev.class = devfreq_event_class;
52d1ab5e Chanwoo Choi 2014-07-18  66  
52d1ab5e Chanwoo Choi 2014-07-18  67dev_set_name(edev-dev, event.%d,
52d1ab5e Chanwoo Choi 2014-07-18  68 
atomic_inc_return(event_no) - 1);
52d1ab5e Chanwoo Choi 2014-07-18  69ret = device_register(edev-dev);
52d1ab5e Chanwoo Choi 2014-07-18  70if (ret != 0) {
52d1ab5e Chanwoo Choi 2014-07-18  71put_device(edev-dev);
52d1ab5e Chanwoo Choi 2014-07-18  72goto err;
52d1ab5e Chanwoo Choi 2014-07-18  73}
52d1ab5e Chanwoo Choi 2014-07-18  74dev_set_drvdata(edev-dev, edev);
52d1ab5e Chanwoo Choi 2014-07-18  75  
52d1ab5e Chanwoo Choi 2014-07-18  76/* Add devfreq event device to 
devfreq_event_list */
52d1ab5e Chanwoo Choi 2014-07-18  77INIT_LIST_HEAD(edev-node);
52d1ab5e Chanwoo Choi 2014-07-18  78list_add(edev-node, 
devfreq_event_list);
52d1ab5e Chanwoo Choi 2014-07-18  79  
52d1ab5e Chanwoo Choi 2014-07-18  80mutex_unlock(devfreq_event_list_lock);
52d1ab5e Chanwoo Choi 2014-07-18  81  
52d1ab5e Chanwoo Choi 2014-07-18  82return edev;
52d1ab5e Chanwoo Choi 2014-07-18  83  err:
52d1ab5e Chanwoo Choi 2014-07-18  84kfree(edev);
52d1ab5e Chanwoo Choi 2014-07-18  85return ERR_PTR(ret);
52d1ab5e Chanwoo Choi 2014-07-18  86  }
52d1ab5e Chanwoo Choi 2014-07-18  87  EXPORT_SYMBOL(devfreq_add_event_device);
52d1ab5e Chanwoo Choi 2014-07-18  88  

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [vireshk:cpufreq/governor-fixes 2/2] drivers/cpufreq/cpufreq.c:938:34: sparse: odd constant _Bool cast (5 becomes 1)

2014-09-08 Thread Dan Carpenter
tree:   git://git.linaro.org/people/vireshk/linux cpufreq/governor-fixes
head:   250686bfdbb183a9d798b071d32972b65d35c915
commit: 250686bfdbb183a9d798b071d32972b65d35c915 [2/2] cpufreq: Track 
governor-state with 'policy-governor_state'
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

 drivers/cpufreq/cpufreq.c:938:34: sparse: odd constant _Bool cast (5 becomes 
 1)

git remote add vireshk git://git.linaro.org/people/vireshk/linux
git remote update vireshk
git checkout 250686bfdbb183a9d798b071d32972b65d35c915
vim +938 drivers/cpufreq/cpufreq.c

ecf7e461 Dave Jones   2009-07-08  922   goto err_out_kobj_put;
ecf7e461 Dave Jones   2009-07-08  923  
e18f1682 Srivatsa S. Bhat 2013-07-30  924   return ret;
e18f1682 Srivatsa S. Bhat 2013-07-30  925  
e18f1682 Srivatsa S. Bhat 2013-07-30  926  err_out_kobj_put:
e18f1682 Srivatsa S. Bhat 2013-07-30  927   kobject_put(policy-kobj);
e18f1682 Srivatsa S. Bhat 2013-07-30  928   
wait_for_completion(policy-kobj_unregister);
e18f1682 Srivatsa S. Bhat 2013-07-30  929   return ret;
e18f1682 Srivatsa S. Bhat 2013-07-30  930  }
e18f1682 Srivatsa S. Bhat 2013-07-30  931  
e18f1682 Srivatsa S. Bhat 2013-07-30  932  static void 
cpufreq_init_policy(struct cpufreq_policy *policy)
e18f1682 Srivatsa S. Bhat 2013-07-30  933  {
6e2c89d1 viresh kumar 2014-03-04  934   struct cpufreq_governor *gov = 
NULL;
e18f1682 Srivatsa S. Bhat 2013-07-30  935   struct cpufreq_policy 
new_policy;
e18f1682 Srivatsa S. Bhat 2013-07-30  936   int ret = 0;
e18f1682 Srivatsa S. Bhat 2013-07-30  937  
250686bf Viresh Kumar 2014-09-08 @938   policy-governor_state = 
CPUFREQ_GOV_POLICY_EXIT;
d5b73cd8 Viresh Kumar 2013-08-06  939   memcpy(new_policy, policy, 
sizeof(*policy));
a27a9ab7 Jason Baron  2013-12-19  940  
6e2c89d1 viresh kumar 2014-03-04  941   /* Update governor of 
new_policy to the governor used before hotplug */
6e2c89d1 viresh kumar 2014-03-04  942   gov = 
__find_governor(per_cpu(cpufreq_cpu_governor, policy-cpu));
6e2c89d1 viresh kumar 2014-03-04  943   if (gov)
6e2c89d1 viresh kumar 2014-03-04  944   pr_debug(Restoring 
governor %s for cpu %d\n,
6e2c89d1 viresh kumar 2014-03-04  945   
policy-governor-name, policy-cpu);
6e2c89d1 viresh kumar 2014-03-04  946   else

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [dhowells-fs:modsign-pkcs7 10/13] crypto/asymmetric_keys/pkcs7_trust.c:90 pkcs7_validate_trust_one() error: we previously assumed 'x509' could be null (see line 43)

2014-09-09 Thread Dan Carpenter
[ My guess is the pr_err() should print last-index instead of
  x509-index? - dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs 
modsign-pkcs7
head:   1148a967cac3bcea81a6910660ddb6cda7b067d4
commit: 7f2d0d9924b26de3f059972a01cc55fbafb24956 [10/13] PKCS#7: Handle PKCS#7 
messages that contain no X.509 certs

crypto/asymmetric_keys/pkcs7_trust.c:90 pkcs7_validate_trust_one() error: we 
previously assumed 'x509' could be null (see line 43)

git remote add dhowells-fs 
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
git remote update dhowells-fs
git checkout 7f2d0d9924b26de3f059972a01cc55fbafb24956
vim +/x509 +90 crypto/asymmetric_keys/pkcs7_trust.c

08815b62 David Howells 2014-07-01  37  
0fc6b54f David Howells 2014-09-08  38   if (sinfo-unsupported_crypto) {
0fc6b54f David Howells 2014-09-08  39   kleave( = -ENOPKG [cached]);
0fc6b54f David Howells 2014-09-08  40   return -ENOPKG;
0fc6b54f David Howells 2014-09-08  41   }
0fc6b54f David Howells 2014-09-08  42  
08815b62 David Howells 2014-07-01  43   for (x509 = sinfo-signer; x509; x509 = 
x509-signer) {
08815b62 David Howells 2014-07-01  44   if (x509-seen) {
08815b62 David Howells 2014-07-01  45   if (x509-verified) {
08815b62 David Howells 2014-07-01  46   trusted = 
x509-trusted;
08815b62 David Howells 2014-07-01  47   goto verified;
08815b62 David Howells 2014-07-01  48   }
08815b62 David Howells 2014-07-01  49   kleave( = -ENOKEY 
[cached]);
08815b62 David Howells 2014-07-01  50   return -ENOKEY;
08815b62 David Howells 2014-07-01  51   }
08815b62 David Howells 2014-07-01  52   x509-seen = true;
08815b62 David Howells 2014-07-01  53  
08815b62 David Howells 2014-07-01  54   /* Look to see if this 
certificate is present in the trusted
08815b62 David Howells 2014-07-01  55* keys.
08815b62 David Howells 2014-07-01  56*/
061ab8ff David Howells 2014-09-05  57   key = 
x509_request_asymmetric_key(trust_keyring, x509-id);
7f2d0d99 David Howells 2014-09-08  58   if (!IS_ERR(key)) {
08815b62 David Howells 2014-07-01  59   /* One of the X.509 
certificates in the PKCS#7 message
08815b62 David Howells 2014-07-01  60* is apparently the 
same as one we already trust.
08815b62 David Howells 2014-07-01  61* Verify that the 
trusted variant can also validate
08815b62 David Howells 2014-07-01  62* the signature on the 
descendant.
08815b62 David Howells 2014-07-01  63*/
7f2d0d99 David Howells 2014-09-08  64   pr_devel(sinfo %u: 
Cert %u as key %x\n,
7f2d0d99 David Howells 2014-09-08  65sinfo-index, 
x509-index, key_serial(key));
08815b62 David Howells 2014-07-01  66   goto matched;
7f2d0d99 David Howells 2014-09-08  67   }
08815b62 David Howells 2014-07-01  68   if (key == ERR_PTR(-ENOMEM))
08815b62 David Howells 2014-07-01  69   return -ENOMEM;
08815b62 David Howells 2014-07-01  70  
08815b62 David Howells 2014-07-01  71/* Self-signed certificates 
form roots of their own, and if we
08815b62 David Howells 2014-07-01  72 * don't know them, then we 
can't accept them.
08815b62 David Howells 2014-07-01  73 */
08815b62 David Howells 2014-07-01  74   if (x509-next == x509) {
08815b62 David Howells 2014-07-01  75   kleave( = -ENOKEY 
[unknown self-signed]);
08815b62 David Howells 2014-07-01  76   return -ENOKEY;
08815b62 David Howells 2014-07-01  77   }
08815b62 David Howells 2014-07-01  78  
08815b62 David Howells 2014-07-01  79   might_sleep();
08815b62 David Howells 2014-07-01  80   last = x509;
08815b62 David Howells 2014-07-01  81   sig = last-sig;
08815b62 David Howells 2014-07-01  82   }
08815b62 David Howells 2014-07-01  83  
08815b62 David Howells 2014-07-01  84   /* No match - see if the root 
certificate has a signer amongst the
08815b62 David Howells 2014-07-01  85* trusted keys.
08815b62 David Howells 2014-07-01  86*/
7f2d0d99 David Howells 2014-09-08  87   if (last  last-authority) {
061ab8ff David Howells 2014-09-05  88   key = 
x509_request_asymmetric_key(trust_keyring, last-authority);
7f2d0d99 David Howells 2014-09-08  89   if (!IS_ERR(key)) {
7f2d0d99 David Howells 2014-09-08  90   pr_devel(sinfo %u: 
Root cert %u signer is key %x\n,
7f2d0d99 David Howells 2014-09-08  91sinfo-index, 
x509-index, key_serial(key));
08815b62 David Howells 2014-07-01  92   x509 = last;
7f2d0d99 David Howells 2014-09-08  93   goto matched;

---
0-DAY kernel build testing backend  Open Source Technology Center

Re: [kbuild] [arm-integrator:realview-dt 1/6] drivers/leds/leds-syscon.c:74:27-28: syscon_match is not NULL terminated at line 74

2014-09-10 Thread Dan Carpenter
On Wed, Sep 10, 2014 at 03:55:37PM +0200, Julia Lawall wrote:
 Needs attention.
 

The attachment was lost.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [platform-drivers-x86:testing 8/8] drivers/platform/x86/toshiba_acpi.c:1352 toshiba_touchpad_store() warn: was intended here instead of ||?

2014-09-10 Thread Dan Carpenter
On Wed, Sep 10, 2014 at 07:59:17AM -0700, Darren Hart wrote:
 On 9/10/14, 0:12, Dan Carpenter dan.carpen...@oracle.com wrote:
 
 tree:   
 git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git
 testing
 head:   58e642de0a6fba870c2bba86f3e92c68df1fd42e
 commit: 58e642de0a6fba870c2bba86f3e92c68df1fd42e [8/8] toshiba_acpi:
 Change touchpad store to check for invalid values
 
 drivers/platform/x86/toshiba_acpi.c:1352 toshiba_touchpad_store() warn:
 was  intended here instead of ||?
 
 Fengguang,
 
 What is this checking for? It was supposed to be a ||, but I'm wondering
 what triggered this report?
 

Look again carefully.  ;)  It was supposed to be .  The current code
always returns -EINVAL.

But the warning message is poor...

 58e642de0 Azael Avalos 2014-09-05 @1352  if (state != 0 || state != 1)
 58e642de0 Azael Avalos 2014-09-05  1353  return -EINVAL;

regards,
dan carpenter
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [amirv:for-netdev 324/327] drivers/infiniband/hw/mlx5/qp.c:3160 mlx5_ib_create_dct() error: potentially dereferencing uninitialized 'dev'.

2014-09-11 Thread Dan Carpenter
tree:   git://flatbed.openfabrics.org/~amirv/linux.git for-netdev
head:   1c1627f7007590393b4d090ff08133b7b5005a0d
commit: 6cc37e98d61a056d96d8c3a1e7b3826d022e2eba [324/327] IB/mlx5: Add DC 
transport support [topic: 3.17-series]

drivers/infiniband/hw/mlx5/qp.c:3160 mlx5_ib_create_dct() error: potentially 
dereferencing uninitialized 'dev'.

git remote add amirv git://flatbed.openfabrics.org/~amirv/linux.git
git remote update amirv
git checkout 6cc37e98d61a056d96d8c3a1e7b3826d022e2eba
vim +/dev +3160 drivers/infiniband/hw/mlx5/qp.c

6cc37e98 Eli Cohen 2014-08-25  3144   struct 
ib_udata *uhw)
6cc37e98 Eli Cohen 2014-08-25  3145  {
6cc37e98 Eli Cohen 2014-08-25  3146 void *in;
6cc37e98 Eli Cohen 2014-08-25  3147 int in_sz = 
MLX5_ST_SZ_BYTES(create_dct_in);
6cc37e98 Eli Cohen 2014-08-25  3148 void *dctx;
6cc37e98 Eli Cohen 2014-08-25  3149 struct mlx5_ib_dev *dev;
6cc37e98 Eli Cohen 2014-08-25  3150 struct mlx5_ib_dct *dct;
6cc37e98 Eli Cohen 2014-08-25  3151 struct mlx5_ib_create_dct ucmd;
6cc37e98 Eli Cohen 2014-08-25  3152 struct mlx5_ib_create_dct_resp resp;
6cc37e98 Eli Cohen 2014-08-25  3153 int cqe_sz;
6cc37e98 Eli Cohen 2014-08-25  3154 u32 cqn;
6cc37e98 Eli Cohen 2014-08-25  3155 int err;
6cc37e98 Eli Cohen 2014-08-25  3156  
6cc37e98 Eli Cohen 2014-08-25  3157 if (uhw) {
6cc37e98 Eli Cohen 2014-08-25  3158 err = ib_copy_from_udata(ucmd, 
uhw, sizeof(ucmd));
6cc37e98 Eli Cohen 2014-08-25  3159 if (err) {
6cc37e98 Eli Cohen 2014-08-25 @3160 mlx5_ib_dbg(dev, copy 
failed\n);
6cc37e98 Eli Cohen 2014-08-25  3161 return ERR_PTR(err);
6cc37e98 Eli Cohen 2014-08-25  3162 }
6cc37e98 Eli Cohen 2014-08-25  3163  
6cc37e98 Eli Cohen 2014-08-25  3164 if (ucmd.reserved0 || 
ucmd.reserved1)
6cc37e98 Eli Cohen 2014-08-25  3165 return ERR_PTR(-EINVAL);
6cc37e98 Eli Cohen 2014-08-25  3166 }
6cc37e98 Eli Cohen 2014-08-25  3167 dev = to_mdev(pd-device);
6cc37e98 Eli Cohen 2014-08-25  3168 dct = kzalloc(sizeof(*dct), GFP_KERNEL);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [amirv:for-netdev 323/327] drivers/infiniband/core/uverbs_cmd.c:3561:15: sparse: memset with byte count of 0

2014-09-11 Thread Dan Carpenter
[ Oddly enough sizeof(resp) *is* zero.  -dan ]

tree:   git://flatbed.openfabrics.org/~amirv/linux.git for-netdev
head:   1c1627f7007590393b4d090ff08133b7b5005a0d
commit: 229a74d98862e6b8cc639885292e01940f57225a [323/327] IB/core: Add DC 
transport support [topic: 3.17-series]
reproduce:
  # apt-get install sparse
  git checkout 229a74d98862e6b8cc639885292e01940f57225a
  make ARCH=x86_64 allmodconfig
  make C=1 CF=-D__CHECK_ENDIAN__

 drivers/infiniband/core/uverbs_cmd.c:3561:15: sparse: memset with byte count 
 of 0

git remote add amirv git://flatbed.openfabrics.org/~amirv/linux.git
git remote update amirv
git checkout 229a74d98862e6b8cc639885292e01940f57225a
vim +3561 drivers/infiniband/core/uverbs_cmd.c

229a74d9 Eli Cohen 2014-08-25  3545 if (out_len  sizeof(resp))
229a74d9 Eli Cohen 2014-08-25  3546 return -ENOSPC;
229a74d9 Eli Cohen 2014-08-25  3547  
229a74d9 Eli Cohen 2014-08-25  3548 err = ib_copy_from_udata(cmd, ucore, 
sizeof(cmd));
229a74d9 Eli Cohen 2014-08-25  3549 if (err)
229a74d9 Eli Cohen 2014-08-25  3550 return err;
229a74d9 Eli Cohen 2014-08-25  3551  
229a74d9 Eli Cohen 2014-08-25  3552 dct = idr_read_dct(cmd.dct_handle, 
file-ucontext);
229a74d9 Eli Cohen 2014-08-25  3553 if (!dct)
229a74d9 Eli Cohen 2014-08-25  3554 return -EINVAL;
229a74d9 Eli Cohen 2014-08-25  3555  
229a74d9 Eli Cohen 2014-08-25  3556 err = dct-device-ex_arm_dct(dct, uhw);
229a74d9 Eli Cohen 2014-08-25  3557 put_dct_read(dct);
229a74d9 Eli Cohen 2014-08-25  3558 if (err)
229a74d9 Eli Cohen 2014-08-25  3559 return err;
229a74d9 Eli Cohen 2014-08-25  3560  
229a74d9 Eli Cohen 2014-08-25 @3561 memset(resp, 0, sizeof(resp));
229a74d9 Eli Cohen 2014-08-25  3562 err = ib_copy_to_udata(ucore, resp, 
sizeof(resp));
229a74d9 Eli Cohen 2014-08-25  3563  
229a74d9 Eli Cohen 2014-08-25  3564 return err;
229a74d9 Eli Cohen 2014-08-25  3565  }
229a74d9 Eli Cohen 2014-08-25  3566  
229a74d9 Eli Cohen 2014-08-25  3567  int ib_uverbs_ex_query_dct(struct 
ib_uverbs_file *file,
229a74d9 Eli Cohen 2014-08-25  3568struct ib_udata 
*ucore,
229a74d9 Eli Cohen 2014-08-25  3569struct ib_udata *uhw)

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [microblaze:xnext/usb 1/1] drivers/usb/gadget/udc/udc-xilinx.c:1162 xudc_ep_dequeue() warn: inconsistent returns spin_lock:udc-lock: locked (1157 [(-22)]) unlocked (1162 [0])

2014-09-11 Thread Dan Carpenter
tree:   git://git.monstr.eu/linux-2.6-microblaze xnext/usb
head:   f95408d41cf2967aceb604e737a8ce646988a366
commit: f95408d41cf2967aceb604e737a8ce646988a366 [1/1] usb: gadget: Add xilinx 
usb2 device support

drivers/usb/gadget/udc/udc-xilinx.c:1162 xudc_ep_dequeue() warn: inconsistent 
returns spin_lock:udc-lock: locked (1157 [(-22)]) unlocked (1162 [0])

git remote add microblaze git://git.monstr.eu/linux-2.6-microblaze
git remote update microblaze
git checkout f95408d41cf2967aceb604e737a8ce646988a366
vim +1162 drivers/usb/gadget/udc/udc-xilinx.c

f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1146  struct xusb_udc *udc
= ep-udc;
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1147  unsigned long flags;
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1148  
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1149  
spin_lock_irqsave(udc-lock, flags);
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1150  /* Make sure it's 
actually queued on this endpoint */
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1151  
list_for_each_entry(req, ep-queue, queue) {
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1152  if 
(req-usb_req == _req)
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1153  break;
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1154  }
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1155  if (req-usb_req != 
_req) {
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1156  
spin_unlock_irqrestore(ep-udc-lock, flags);

Smatch is confused.  Change ep-udc-lock to udc-lock to make the
warning go away.

f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1157  return -EINVAL;
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1158  }
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1159  xudc_done(ep, req, 
-ECONNRESET);
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1160  
spin_unlock_irqrestore(udc-lock, flags);
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1161  
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11 @1162  return 0;
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1163  }
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1164  
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1165  /**
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1166   * xudc_ep0_enable - 
Enables the given endpoint.
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1167   * @ep: pointer to the usb 
endpoint structure.
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1168   * @desc: pointer to usb 
endpoint descriptor.
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1169   *
f95408d4 Subbaraya Sundeep Bhatta 2014-09-11  1170   * Return: error always.

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 184/193] net/sched/cls_tcindex.c:244 tcindex_set_parms() error: not allocating enough data 40 vs 4

2014-09-15 Thread Dan Carpenter
[ Also I was wondering if you could take a look at:

net/sched/cls_tcindex.c:259 tcindex_set_parms()
warn: missing error code here? 'kmemdup()' failed.

   255  if (p-perfect) {
   256  cp-perfect = kmemdup(p-perfect,
   257sizeof(*r) * cp-hash, 
GFP_KERNEL);
   258  if (!cp-perfect)
   259  goto errout;

err = -ENOMEM here?

   260  }
   261  cp-h = p-h;

 -dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   b25bd2515ea32cf5ddd5fd5a2a93b8c9dd875e4f
commit: 331b72922c5f58d48fd5500acadc91777cc31970 [184/193] net: sched: RCU 
cls_tcindex

New smatch warnings:
net/sched/cls_tcindex.c:244 tcindex_set_parms() error: not allocating enough 
data 40 vs 4

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout 331b72922c5f58d48fd5500acadc91777cc31970
vim +244 net/sched/cls_tcindex.c

^1da177e Linus Torvalds 2005-04-16  228 int err, balloc = 0;
^1da177e Linus Torvalds 2005-04-16  229 struct tcindex_filter_result 
new_filter_result, *old_r = r;
^1da177e Linus Torvalds 2005-04-16  230 struct tcindex_filter_result cr;
331b7292 John Fastabend 2014-09-12  231 struct tcindex_data *cp, *oldp;
^1da177e Linus Torvalds 2005-04-16  232 struct tcindex_filter *f = 
NULL; /* make gcc behave */
^1da177e Linus Torvalds 2005-04-16  233 struct tcf_exts e;
^1da177e Linus Torvalds 2005-04-16  234  
5da57f42 WANG Cong  2013-12-15  235 tcf_exts_init(e, 
TCA_TCINDEX_ACT, TCA_TCINDEX_POLICE);
2f7ef2f8 Cong Wang  2014-04-25  236 err = tcf_exts_validate(net, 
tp, tb, est, e, ovr);
^1da177e Linus Torvalds 2005-04-16  237 if (err  0)
^1da177e Linus Torvalds 2005-04-16  238 return err;
^1da177e Linus Torvalds 2005-04-16  239  
331b7292 John Fastabend 2014-09-12  240 /* tcindex_data attributes must 
look atomic to classifier/lookup so
331b7292 John Fastabend 2014-09-12  241  * allocate new tcindex data 
and RCU assign it onto root. Keeping
331b7292 John Fastabend 2014-09-12  242  * perfect hash and hash 
pointers from old data.
331b7292 John Fastabend 2014-09-12  243  */
331b7292 John Fastabend 2014-09-12 @244 cp = kzalloc(sizeof(cp), 
GFP_KERNEL);
 ^^
This should be sizeof(*cp) obviously.

331b7292 John Fastabend 2014-09-12  245 if (!cp)
331b7292 John Fastabend 2014-09-12  246 return -ENOMEM;
331b7292 John Fastabend 2014-09-12  247  
331b7292 John Fastabend 2014-09-12  248 cp-mask = p-mask;
331b7292 John Fastabend 2014-09-12  249 cp-shift = p-shift;
331b7292 John Fastabend 2014-09-12  250 cp-hash = p-hash;
331b7292 John Fastabend 2014-09-12  251 cp-alloc_hash = p-alloc_hash;
331b7292 John Fastabend 2014-09-12  252 cp-fall_through = 
p-fall_through;

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 625/646] net/sched/cls_cgroup.c:130 cls_cgroup_change() warn: possible memory leak of 'new'

2014-09-15 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   54996b529ab70ca1d6f40677cd2698c4f7127e87
commit: c7953ef23042b7c4fc2be5ecdd216aacff6df5eb [625/646] net: sched: 
cls_cgroup use RCU

net/sched/cls_cgroup.c:130 cls_cgroup_change() warn: possible memory leak of 
'new'
net/sched/cls_cgroup.c:135 cls_cgroup_change() warn: possible memory leak of 
'new'
net/sched/cls_cgroup.c:139 cls_cgroup_change() warn: possible memory leak of 
'new'

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout c7953ef23042b7c4fc2be5ecdd216aacff6df5eb
vim +/new +130 net/sched/cls_cgroup.c

f4009237 Thomas Graf2008-11-07  124 }
f4009237 Thomas Graf2008-11-07  125  
c7953ef2 John Fastabend 2014-09-12  126 new-tp = tp;
f4009237 Thomas Graf2008-11-07  127 err = nla_parse_nested(tb, 
TCA_CGROUP_MAX, tca[TCA_OPTIONS],
f4009237 Thomas Graf2008-11-07  128
cgroup_policy);
f4009237 Thomas Graf2008-11-07  129 if (err  0)
f4009237 Thomas Graf2008-11-07  130 return err;
f4009237 Thomas Graf2008-11-07  131  
5da57f42 WANG Cong  2013-12-15  132 tcf_exts_init(e, 
TCA_CGROUP_ACT, TCA_CGROUP_POLICE);
2f7ef2f8 Cong Wang  2014-04-25  133 err = tcf_exts_validate(net, 
tp, tb, tca[TCA_RATE], e, ovr);
f4009237 Thomas Graf2008-11-07  134 if (err  0)
f4009237 Thomas Graf2008-11-07  135 return err;
f4009237 Thomas Graf2008-11-07  136  
f4009237 Thomas Graf2008-11-07  137 err = tcf_em_tree_validate(tp, 
tb[TCA_CGROUP_EMATCHES], t);
f4009237 Thomas Graf2008-11-07  138 if (err  0)
f4009237 Thomas Graf2008-11-07  139 return err;
f4009237 Thomas Graf2008-11-07  140  
c7953ef2 John Fastabend 2014-09-12  141 tcf_exts_change(tp, new-exts, 
e);
c7953ef2 John Fastabend 2014-09-12  142 tcf_em_tree_change(tp, 
new-ematches, t);

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 182/193] net/sched/cls_fw.c:279 fw_change() error: we previously assumed 'pfp' could be null (see line 274)

2014-09-15 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   b25bd2515ea32cf5ddd5fd5a2a93b8c9dd875e4f
commit: e35a8ee5993ba81fd6c092f6827458c60406255b [182/193] net: sched: fw use 
RCU

net/sched/cls_fw.c:279 fw_change() error: we previously assumed 'pfp' could be 
null (see line 274)

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout e35a8ee5993ba81fd6c092f6827458c60406255b
vim +/pfp +279 net/sched/cls_fw.c

e35a8ee5 John Fastabend 2014-09-12  268 if (err  0) {
e35a8ee5 John Fastabend 2014-09-12  269 kfree(fnew);
e35a8ee5 John Fastabend 2014-09-12  270 return err;
e35a8ee5 John Fastabend 2014-09-12  271 }
e35a8ee5 John Fastabend 2014-09-12  272  
e35a8ee5 John Fastabend 2014-09-12  273 fp = 
head-ht[fw_hash(fnew-id)];
e35a8ee5 John Fastabend 2014-09-12  274 for (pfp = 
rtnl_dereference(*fp); pfp;
e35a8ee5 John Fastabend 2014-09-12  275  fp = pfp-next, 
pfp = rtnl_dereference(*fp))
e35a8ee5 John Fastabend 2014-09-12  276 if (pfp == f)
e35a8ee5 John Fastabend 2014-09-12  277 break;
e35a8ee5 John Fastabend 2014-09-12  278  
e35a8ee5 John Fastabend 2014-09-12  279 
RCU_INIT_POINTER(fnew-next, rtnl_dereference(pfp-next));
e35a8ee5 John Fastabend 2014-09-12  280 rcu_assign_pointer(*fp, 
fnew);
e35a8ee5 John Fastabend 2014-09-12  281 call_rcu(f-rcu, 
fw_delete_filter);
e35a8ee5 John Fastabend 2014-09-12  282  

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [wireless-next:master 81/102] drivers/net/wireless/mwifiex/scan.c:943 mwifiex_config_scan() error: we previously assumed 'user_scan_in' could be null (see line 839)

2014-09-15 Thread Dan Carpenter
tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   1030f9fe65602465a89beaa05c3343cf9fd68a88
commit: cb91be87e12c079fcf25069a21123756c0931dd6 [81/102] mwifiex: bring in 
scan channel gap feature

drivers/net/wireless/mwifiex/scan.c:943 mwifiex_config_scan() error: we 
previously assumed 'user_scan_in' could be null (see line 839)
drivers/net/wireless/mwifiex/scan.c:1003 mwifiex_config_scan() warn: variable 
dereferenced before check 'user_scan_in' (see line 956)

git remote add wireless-next 
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git
git remote update wireless-next
git checkout cb91be87e12c079fcf25069a21123756c0931dd6
vim +/user_scan_in +943 drivers/net/wireless/mwifiex/scan.c

5e6e3a92b Bing Zhao  2011-03-21   833  
5e6e3a92b Bing Zhao  2011-03-21   834   /* Initialize the scan as not 
being only on the current channel.  If
5e6e3a92b Bing Zhao  2011-03-21   835  the channel list is 
customized, only contains one channel, and is
5e6e3a92b Bing Zhao  2011-03-21   836  the active channel, this is 
set true and data flow is not halted. */
5e6e3a92b Bing Zhao  2011-03-21   837   *scan_current_only = false;
5e6e3a92b Bing Zhao  2011-03-21   838  
5e6e3a92b Bing Zhao  2011-03-21   839   if (user_scan_in) {
5e6e3a92b Bing Zhao  2011-03-21   840  
5e6e3a92b Bing Zhao  2011-03-21   841   /* Default the 
ssid_filter flag to TRUE, set false under
5e6e3a92b Bing Zhao  2011-03-21   842  certain wildcard 
conditions and qualified by the existence
5e6e3a92b Bing Zhao  2011-03-21   843  of an SSID list 
before marking the scan as filtered */
5e6e3a92b Bing Zhao  2011-03-21   844   ssid_filter = true;
5e6e3a92b Bing Zhao  2011-03-21   845  
5e6e3a92b Bing Zhao  2011-03-21   846   /* Set the BSS type 
scan filter, use Adapter setting if
5e6e3a92b Bing Zhao  2011-03-21   847  unset */
5e6e3a92b Bing Zhao  2011-03-21   848   scan_cfg_out-bss_mode =
5e6e3a92b Bing Zhao  2011-03-21   849   
(user_scan_in-bss_mode ? (u8) user_scan_in-
5e6e3a92b Bing Zhao  2011-03-21   850bss_mode : 
(u8) adapter-scan_mode);
5e6e3a92b Bing Zhao  2011-03-21   851  
5e6e3a92b Bing Zhao  2011-03-21   852   /* Set the number of 
probes to send, use Adapter setting
5e6e3a92b Bing Zhao  2011-03-21   853  if unset */
5e6e3a92b Bing Zhao  2011-03-21   854   num_probes =
5e6e3a92b Bing Zhao  2011-03-21   855   
(user_scan_in-num_probes ? user_scan_in-
5e6e3a92b Bing Zhao  2011-03-21   856num_probes : 
adapter-scan_probes);
5e6e3a92b Bing Zhao  2011-03-21   857  
5e6e3a92b Bing Zhao  2011-03-21   858   /*
5e6e3a92b Bing Zhao  2011-03-21   859* Set the BSSID filter 
to the incoming configuration,
5e6e3a92b Bing Zhao  2011-03-21   860* if non-zero.  If not 
set, it will remain disabled
5e6e3a92b Bing Zhao  2011-03-21   861* (all zeros).
5e6e3a92b Bing Zhao  2011-03-21   862*/
5e6e3a92b Bing Zhao  2011-03-21   863   
memcpy(scan_cfg_out-specific_bssid,
5e6e3a92b Bing Zhao  2011-03-21   864  
user_scan_in-specific_bssid,
5e6e3a92b Bing Zhao  2011-03-21   865  
sizeof(scan_cfg_out-specific_bssid));
5e6e3a92b Bing Zhao  2011-03-21   866  
21f58d200 Amitkumar Karwar   2014-02-11   867   if (adapter-ext_scan 
21f58d200 Amitkumar Karwar   2014-02-11   868   
!is_zero_ether_addr(scan_cfg_out-specific_bssid)) {
21f58d200 Amitkumar Karwar   2014-02-11   869   bssid_tlv =
21f58d200 Amitkumar Karwar   2014-02-11   870   (struct 
mwifiex_ie_types_bssid_list *)tlv_pos;
21f58d200 Amitkumar Karwar   2014-02-11   871   
bssid_tlv-header.type = cpu_to_le16(TLV_TYPE_BSSID);
21f58d200 Amitkumar Karwar   2014-02-11   872   
bssid_tlv-header.len = cpu_to_le16(ETH_ALEN);
21f58d200 Amitkumar Karwar   2014-02-11   873   
memcpy(bssid_tlv-bssid, user_scan_in-specific_bssid,
21f58d200 Amitkumar Karwar   2014-02-11   874  
ETH_ALEN);
21f58d200 Amitkumar Karwar   2014-02-11   875   tlv_pos += 
sizeof(struct mwifiex_ie_types_bssid_list);
21f58d200 Amitkumar Karwar   2014-02-11   876   }
21f58d200 Amitkumar Karwar   2014-02-11   877  
be0b281e8 Amitkumar Karwar   2012-02-27   878   for (i = 0; i  
user_scan_in-num_ssids; i++) {
be0b281e8 Amitkumar Karwar   2012-02-27   879   ssid_len = 
user_scan_in-ssid_list[i].ssid_len;
5e6e3a92b Bing Zhao  2011-03-21   880  
5e6e3a92b Bing Zhao  

Re: [kbuild] [nfc-next:master 42/63] drivers/nfc/trf7970a.c:836:5-11: preceding lock on line 740

2014-09-19 Thread Dan Carpenter
On Thu, Sep 18, 2014 at 02:21:01PM -0700, Mark A. Greer wrote:
 Hi Julia.  Sorry for the delay, I've been on vacation.
 
drivers/nfc/trf7970a.c:836:5-11: preceding lock on line 740
drivers/nfc/trf7970a.c:849:5-11: preceding lock on line 740
drivers/nfc/trf7970a.c:1630:2-8: preceding lock on line 1599
 
 I'm not sure what these messages are trying to tell me.
 Any hints?
 

There is a return on line 836 which didn't release the lock from line
740.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [pm:bleeding-edge 107/110] drivers/acpi/sbs.c:441:28: sparse: dubious: !x y

2014-09-25 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git 
bleeding-edge
head:   3b2a67026846080f7ee251e8984ed8f414137ca8
commit: 3031cddea633ea5328162d3d712a582e4205dbed [107/110] ACPI / SBS: Don't 
assume the existence of an SBS charger
reproduce:
  # apt-get install sparse
  git checkout 3031cddea633ea5328162d3d712a582e4205dbed
  make ARCH=x86_64 allmodconfig
  make C=1 CF=-D__CHECK_ENDIAN__

 drivers/acpi/sbs.c:441:28: sparse: dubious: !x  y

git remote add pm 
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
git remote update pm
git checkout 3031cddea633ea5328162d3d712a582e4205dbed
vim +441 drivers/acpi/sbs.c

3f86b832 Rich Townsend   2006-07-01  425  
3f86b832 Rich Townsend   2006-07-01  426  static int 
acpi_ac_get_present(struct acpi_sbs *sbs)
3f86b832 Rich Townsend   2006-07-01  427  {
db1c291a Alexey Starikovskiy 2007-09-26  428int result;
db1c291a Alexey Starikovskiy 2007-09-26  429u16 status;
3f86b832 Rich Townsend   2006-07-01  430  
db1c291a Alexey Starikovskiy 2007-09-26  431result = 
acpi_smbus_read(sbs-hc, SMBUS_READ_WORD, ACPI_SBS_CHARGER,
db1c291a Alexey Starikovskiy 2007-09-26  432 0x13, 
(u8 *)  status);
3031cdde Matthew Garrett 2014-09-20  433  
3031cdde Matthew Garrett 2014-09-20  434if (result)
635227ee Len Brown   2006-07-01  435return result;
3031cdde Matthew Garrett 2014-09-20  436  
3031cdde Matthew Garrett 2014-09-20  437/*
3031cdde Matthew Garrett 2014-09-20  438 * The spec requires that bit 4 
always be 1. If it's not set, assume
3031cdde Matthew Garrett 2014-09-20  439 * that the implementation 
doesn't support an SBS charger
3031cdde Matthew Garrett 2014-09-20  440 */
3031cdde Matthew Garrett 2014-09-20 @441if (!(status  4)  0x1)
3031cdde Matthew Garrett 2014-09-20  442return -ENODEV;
3031cdde Matthew Garrett 2014-09-20  443  
3031cdde Matthew Garrett 2014-09-20  444sbs-charger_present = (status 
 15)  0x1;
3031cdde Matthew Garrett 2014-09-20  445return 0;
3f86b832 Rich Townsend   2006-07-01  446  }
3f86b832 Rich Townsend   2006-07-01  447  
8bd95532 Alexey Starikovskiy 2007-09-26  448  static ssize_t 
acpi_battery_alarm_show(struct device *dev,
8bd95532 Alexey Starikovskiy 2007-09-26  449
struct device_attribute *attr,

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [mmotm:master 57/427] fs/ocfs2/journal.c:2204:9: sparse: context imbalance in 'ocfs2_recover_orphans' - different lock contexts for basic block

2014-09-26 Thread Dan Carpenter
tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   065f1d86a58cc88249cd8371b29a57c97483753a
commit: 8a09937cacc099da21313223443237cbc84d5876 [57/427] ocfs2: add orphan 
recovery types in ocfs2_recover_orphans
reproduce:
  # apt-get install sparse
  git checkout 8a09937cacc099da21313223443237cbc84d5876
  make ARCH=x86_64 allmodconfig
  make C=1 CF=-D__CHECK_ENDIAN__

   fs/ocfs2/journal.c:111:6: sparse: symbol 'ocfs2_replay_map_set_state' was 
not declared. Should it be static?
   fs/ocfs2/journal.c:156:6: sparse: symbol 'ocfs2_queue_replay_slots' was not 
declared. Should it be static?
   fs/ocfs2/journal.c:176:6: sparse: symbol 'ocfs2_free_replay_slots' was not 
declared. Should it be static?
   fs/ocfs2/journal.c:1888:6: sparse: symbol 'ocfs2_queue_orphan_scan' was not 
declared. Should it be static?
   fs/ocfs2/journal.c:1937:6: sparse: symbol 'ocfs2_orphan_scan_work' was not 
declared. Should it be static?
 fs/ocfs2/journal.c:2204:9: sparse: context imbalance in 
 'ocfs2_recover_orphans' - different lock contexts for basic block

git remote add mmotm git://git.cmpxchg.org/linux-mmotm.git
git remote update mmotm
git checkout 8a09937cacc099da21313223443237cbc84d5876
vim +/ocfs2_recover_orphans +2204 fs/ocfs2/journal.c

8a09937c WeiWei Wang 2014-09-26  2188* if the orphan scan work, 
continue to process the
8a09937c WeiWei Wang 2014-09-26  2189* next orphan.
8a09937c WeiWei Wang 2014-09-26  2190*/
8a09937c WeiWei Wang 2014-09-26  2191   else if (orphan_reco_type == 
ORPHAN_SCAN_WORK) {
8a09937c WeiWei Wang 2014-09-26  2192   
spin_unlock(oi-ip_lock);
8a09937c WeiWei Wang 2014-09-26  2193   inode = iter;
8a09937c WeiWei Wang 2014-09-26  2194   continue;
8a09937c WeiWei Wang 2014-09-26  2195   }
ccd979bd Mark Fasheh 2005-12-15  2196   spin_unlock(oi-ip_lock);
ccd979bd Mark Fasheh 2005-12-15  2197  
ccd979bd Mark Fasheh 2005-12-15  2198   iput(inode);
ccd979bd Mark Fasheh 2005-12-15  2199  
ccd979bd Mark Fasheh 2005-12-15  2200   inode = iter;
ccd979bd Mark Fasheh 2005-12-15  2201   }
ccd979bd Mark Fasheh 2005-12-15  2202  
8a09937c WeiWei Wang 2014-09-26  2203  out:

Sparse error messages are hard to understand.  It's saying that there is
a missing unlock if ocfs2_start_trans() fails and we goto out;

out labels are the worst btw.  The name is too vague.  Sometimes they
do something and sometimes they don't do anything but the name doesn't
give any clue what it does.  In theory, out labels future proof the code
from locking bugs but they don't work.  It just means you have to jump
around like a rabbit to follow all the goto paths.  A return statement
is easier to understand.

b4df6ed8 Mark Fasheh 2006-02-22 @2204   return ret;
ccd979bd Mark Fasheh 2005-12-15  2205  }
ccd979bd Mark Fasheh 2005-12-15  2206  
19ece546 Jan Kara2008-08-21  2207  static int __ocfs2_wait_on_mount(struct 
ocfs2_super *osb, int quota)
ccd979bd Mark Fasheh 2005-12-15  2208  {
ccd979bd Mark Fasheh 2005-12-15  2209   /* This check is good because ocfs2 
will wait on our recovery
ccd979bd Mark Fasheh 2005-12-15  2210* thread before changing it to 
something other than MOUNTED
ccd979bd Mark Fasheh 2005-12-15  2211* or DISABLED. */
ccd979bd Mark Fasheh 2005-12-15  2212   wait_event(osb-osb_mount_event,

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [target:for-next 41/41] drivers/vhost/scsi.c:1411:1-7: preceding lock on line 1345

2014-10-10 Thread Dan Carpenter
On Thu, Oct 09, 2014 at 01:51:00PM +0300, Dan Carpenter wrote:
 21828596 drivers/vhost/scsi.c  Nicholas Bellinger 2014-10-08  1370
 ret = configfs_depend_item(se_tpg-se_tpg_tfo-tf_subsys,
 21828596 drivers/vhost/scsi.c  Nicholas Bellinger 2014-10-08  1371
se_tpg-tpg_group.cg_item);
 21828596 drivers/vhost/scsi.c  Nicholas Bellinger 2014-10-08  1372
 if (ret) {
 21828596 drivers/vhost/scsi.c  Nicholas Bellinger 2014-10-08  1373
 pr_warn(configfs_depend_item() failed: %d\n, ret);
 
 There is an unlock() missing here.
 

A related Smatch warning is:
drivers/vhost/scsi.c:1411 vhost_scsi_set_endpoint() warn: possible memory leak 
of 'vs_tpg'

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [asoc:topic/intel 26/28] sound/soc/intel/sst-firmware.c:675:2-8: preceding lock on line 636

2014-10-22 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 
topic/intel
head:   cd51c82524fffc47ca6566532bcc6cf37b4902de
commit: 1715b5408ce98002a0ed5dc6349105133826f3f0 [26/28] ASoC: Intel: update 
scratch allocator to use generic block allocator

 sound/soc/intel/sst-firmware.c:675:2-8: preceding lock on line 636

git remote add asoc 
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
git remote update asoc
git checkout 1715b5408ce98002a0ed5dc6349105133826f3f0
vim +675 sound/soc/intel/sst-firmware.c

1715b540 Liam Girdwood 2014-10-20  630  int sst_block_alloc_scratch(struct 
sst_dsp *dsp)
a4b12990 Mark Brown2014-03-12  631  {
1715b540 Liam Girdwood 2014-10-20  632  struct sst_module *module;
1715b540 Liam Girdwood 2014-10-20  633  struct sst_block_allocator ba;
1715b540 Liam Girdwood 2014-10-20  634  int ret;
a4b12990 Mark Brown2014-03-12  635  
a4b12990 Mark Brown2014-03-12  636  mutex_lock(dsp-mutex);
a4b12990 Mark Brown2014-03-12  637  
a4b12990 Mark Brown2014-03-12  638  /* calculate required scratch 
size */
1715b540 Liam Girdwood 2014-10-20  639  dsp-scratch_size = 0;
1715b540 Liam Girdwood 2014-10-20  640  list_for_each_entry(module, 
dsp-module_list, list) {
1715b540 Liam Girdwood 2014-10-20  641  dev_dbg(dsp-dev, 
module %d scratch req 0x%x bytes\n,
1715b540 Liam Girdwood 2014-10-20  642  module-id, 
module-scratch_size);
1715b540 Liam Girdwood 2014-10-20  643  if (dsp-scratch_size  
module-scratch_size)
1715b540 Liam Girdwood 2014-10-20  644  
dsp-scratch_size = module-scratch_size;
a4b12990 Mark Brown2014-03-12  645  }
a4b12990 Mark Brown2014-03-12  646  
1715b540 Liam Girdwood 2014-10-20  647  dev_dbg(dsp-dev, scratch 
buffer required is 0x%x bytes\n,
1715b540 Liam Girdwood 2014-10-20  648  dsp-scratch_size);
a4b12990 Mark Brown2014-03-12  649  
1715b540 Liam Girdwood 2014-10-20  650  if (dsp-scratch_size == 0) {
1715b540 Liam Girdwood 2014-10-20  651  dev_info(dsp-dev, no 
modules need scratch buffer\n);
1715b540 Liam Girdwood 2014-10-20  652  
mutex_unlock(dsp-mutex);
1715b540 Liam Girdwood 2014-10-20  653  return 0;
1715b540 Liam Girdwood 2014-10-20  654  }
1715b540 Liam Girdwood 2014-10-20  655  
1715b540 Liam Girdwood 2014-10-20  656  ba.size = dsp-scratch_size;
1715b540 Liam Girdwood 2014-10-20  657  ba.type = SST_MEM_DRAM;
1715b540 Liam Girdwood 2014-10-20  658  ba.offset = 0;
a4b12990 Mark Brown2014-03-12  659  
1715b540 Liam Girdwood 2014-10-20  660  dev_dbg(dsp-dev, block 
request 0x%x bytes type %d\n,
1715b540 Liam Girdwood 2014-10-20  661  ba.size, ba.type);
a4b12990 Mark Brown2014-03-12  662  
a4b12990 Mark Brown2014-03-12  663  /* allocate blocks for module 
scratch buffers */
a4b12990 Mark Brown2014-03-12  664  dev_dbg(dsp-dev, allocating 
scratch blocks\n);
1715b540 Liam Girdwood 2014-10-20  665  ret = block_alloc(dsp, ba, 
dsp-scratch_block_list);
a4b12990 Mark Brown2014-03-12  666  if (ret  0) {
a4b12990 Mark Brown2014-03-12  667  dev_err(dsp-dev, 
error: can't alloc scratch blocks\n);
1715b540 Liam Girdwood 2014-10-20  668  
mutex_unlock(dsp-mutex);
1715b540 Liam Girdwood 2014-10-20  669  return ret;
a4b12990 Mark Brown2014-03-12  670  }
a4b12990 Mark Brown2014-03-12  671  
1715b540 Liam Girdwood 2014-10-20  672  ret = block_list_prepare(dsp, 
dsp-scratch_block_list);
1715b540 Liam Girdwood 2014-10-20  673  if (ret  0) {
1715b540 Liam Girdwood 2014-10-20  674  dev_err(dsp-dev, 
error: scratch block prepare failed\n);
1715b540 Liam Girdwood 2014-10-20  675  return ret;
1715b540 Liam Girdwood 2014-10-20  676  }
a4b12990 Mark Brown2014-03-12  677  
1715b540 Liam Girdwood 2014-10-20  678  /* assign the same offset of 
scratch to each module */

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [ulf.hansson-mmc:next 96/99] drivers/mmc/host/toshsd.c:389 toshsd_irq() error: we previously assumed 'host-cmd' could be null (see line 349)

2014-11-12 Thread Dan Carpenter
tree:   https://git.linaro.org/people/ulf.hansson/mmc next
head:   edd9918aa24ccee14f80d0c6e87e89b59223e807
commit: 36b2de044cdf3e3dfc2402a48008aa5ef0849a2b [96/99] mmc: add Toshiba PCI 
SD controller driver

drivers/mmc/host/toshsd.c:389 toshsd_irq() error: we previously assumed 
'host-cmd' could be null (see line 349)

git remote add ulf.hansson-mmc https://git.linaro.org/people/ulf.hansson/mmc
git remote update ulf.hansson-mmc
git checkout 36b2de044cdf3e3dfc2402a48008aa5ef0849a2b
vim +389 drivers/mmc/host/toshsd.c

36b2de04 Ondrej Zary 2014-11-11  343detail  
SD_ERR1_TIMEOUT_CRS_STATUS ? CRS_STATUS_TIMEOUT  : ,
36b2de04 Ondrej Zary 2014-11-11  344detail  
SD_ERR1_TIMEOUT_CRC_BUSY ? CRC_BUSY_TIMEOUT  : );
36b2de04 Ondrej Zary 2014-11-11  345error = -EIO;
36b2de04 Ondrej Zary 2014-11-11  346}
36b2de04 Ondrej Zary 2014-11-11  347  
36b2de04 Ondrej Zary 2014-11-11  348if (error) {
36b2de04 Ondrej Zary 2014-11-11 @349if (host-cmd)
36b2de04 Ondrej Zary 2014-11-11  350host-cmd-error = 
error;
36b2de04 Ondrej Zary 2014-11-11  351  
36b2de04 Ondrej Zary 2014-11-11  352if (error == -ETIMEDOUT) {
36b2de04 Ondrej Zary 2014-11-11  353iowrite32(int_status 
36b2de04 Ondrej Zary 2014-11-11  354  
~(SD_BUF_CMD_TIMEOUT | SD_CARD_RESP_END),
36b2de04 Ondrej Zary 2014-11-11  355  host-ioaddr 
+ SD_CARDSTATUS);
36b2de04 Ondrej Zary 2014-11-11  356} else {
36b2de04 Ondrej Zary 2014-11-11  357toshsd_init(host);
36b2de04 Ondrej Zary 2014-11-11  358
__toshsd_set_ios(host-mmc, host-mmc-ios);
36b2de04 Ondrej Zary 2014-11-11  359goto irq_end;
36b2de04 Ondrej Zary 2014-11-11  360}
36b2de04 Ondrej Zary 2014-11-11  361}
36b2de04 Ondrej Zary 2014-11-11  362  
36b2de04 Ondrej Zary 2014-11-11  363/* Card insert/remove. The mmc 
controlling code is stateless. */
36b2de04 Ondrej Zary 2014-11-11  364if (int_reg  (SD_CARD_CARD_INSERTED_0 
| SD_CARD_CARD_REMOVED_0)) {
36b2de04 Ondrej Zary 2014-11-11  365iowrite32(int_status 
36b2de04 Ondrej Zary 2014-11-11  366  
~(SD_CARD_CARD_REMOVED_0 | SD_CARD_CARD_INSERTED_0),
36b2de04 Ondrej Zary 2014-11-11  367  host-ioaddr + 
SD_CARDSTATUS);
36b2de04 Ondrej Zary 2014-11-11  368  
36b2de04 Ondrej Zary 2014-11-11  369if (int_reg  
SD_CARD_CARD_INSERTED_0)
36b2de04 Ondrej Zary 2014-11-11  370toshsd_init(host);
36b2de04 Ondrej Zary 2014-11-11  371  
36b2de04 Ondrej Zary 2014-11-11  372mmc_detect_change(host-mmc, 1);
36b2de04 Ondrej Zary 2014-11-11  373}
36b2de04 Ondrej Zary 2014-11-11  374  
36b2de04 Ondrej Zary 2014-11-11  375/* Data transfer */
36b2de04 Ondrej Zary 2014-11-11  376if (int_reg  (SD_BUF_READ_ENABLE | 
SD_BUF_WRITE_ENABLE)) {
36b2de04 Ondrej Zary 2014-11-11  377iowrite32(int_status 
36b2de04 Ondrej Zary 2014-11-11  378  ~(SD_BUF_WRITE_ENABLE 
| SD_BUF_READ_ENABLE),
36b2de04 Ondrej Zary 2014-11-11  379  host-ioaddr + 
SD_CARDSTATUS);
36b2de04 Ondrej Zary 2014-11-11  380  
36b2de04 Ondrej Zary 2014-11-11  381ret = IRQ_WAKE_THREAD;
36b2de04 Ondrej Zary 2014-11-11  382goto irq_end;
36b2de04 Ondrej Zary 2014-11-11  383}
36b2de04 Ondrej Zary 2014-11-11  384  
36b2de04 Ondrej Zary 2014-11-11  385/* Command completion */
36b2de04 Ondrej Zary 2014-11-11  386if (int_reg  SD_CARD_RESP_END) {
36b2de04 Ondrej Zary 2014-11-11  387iowrite32(int_status  
~(SD_CARD_RESP_END),
36b2de04 Ondrej Zary 2014-11-11  388  host-ioaddr + 
SD_CARDSTATUS);
36b2de04 Ondrej Zary 2014-11-11 @389toshsd_cmd_irq(host);
36b2de04 Ondrej Zary 2014-11-11  390}
36b2de04 Ondrej Zary 2014-11-11  391  
36b2de04 Ondrej Zary 2014-11-11  392/* Data transfer completion */

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [slave-dma:for-linus 1/37] drivers/dma/at_xdmac.c:933 at_xdmac_tx_status() warn: inconsistent returns 'spin_lock:atchan-lock'.

2014-11-12 Thread Dan Carpenter
[ missing unlock on line 902 - dan]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/slave-dma.git 
for-linus
head:   0005e0d58cee6b4c48416a44619df24214aa8670
commit: e1f7c9eee70730d7e6ec77f7ecc76f936e262cf0 [1/37] dmaengine: at_xdmac: 
creation of the atmel eXtended DMA Controller driver

drivers/dma/at_xdmac.c:933 at_xdmac_tx_status() warn: inconsistent returns 
'spin_lock:atchan-lock'.
  Locked on:   line 902
  Unlocked on: line 887
   line 890
   line 933
drivers/dma/at_xdmac.c:933 at_xdmac_tx_status() warn: inconsistent returns 
'bottom_half:'.
  Locked on:   line 902
  Unlocked on: line 887
   line 890
   line 933

git remote add slave-dma 
git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/slave-dma.git
git remote update slave-dma
git checkout e1f7c9eee70730d7e6ec77f7ecc76f936e262cf0
vim +933 drivers/dma/at_xdmac.c

e1f7c9ee Ludovic Desroches 2014-10-22  917  descs_list = desc-descs_list;
e1f7c9ee Ludovic Desroches 2014-10-22  918  list_for_each_entry_safe(desc, 
_desc, descs_list, desc_node) {
e1f7c9ee Ludovic Desroches 2014-10-22  919  residue -= 
(desc-lld.mbr_ubc  0xff)  dwidth;
e1f7c9ee Ludovic Desroches 2014-10-22  920  if ((desc-lld.mbr_nda 
 0xfffc) == cur_nda)
e1f7c9ee Ludovic Desroches 2014-10-22  921  break;
e1f7c9ee Ludovic Desroches 2014-10-22  922  }
e1f7c9ee Ludovic Desroches 2014-10-22  923  residue += 
at_xdmac_chan_read(atchan, AT_XDMAC_CUBC)  dwidth;
e1f7c9ee Ludovic Desroches 2014-10-22  924  
e1f7c9ee Ludovic Desroches 2014-10-22  925  spin_unlock_bh(atchan-lock);
e1f7c9ee Ludovic Desroches 2014-10-22  926  
e1f7c9ee Ludovic Desroches 2014-10-22  927  dma_set_residue(txstate, 
residue);
e1f7c9ee Ludovic Desroches 2014-10-22  928  
e1f7c9ee Ludovic Desroches 2014-10-22  929  dev_dbg(chan2dev(chan),
e1f7c9ee Ludovic Desroches 2014-10-22  930   %s: desc=0x%p, 
tx_dma_desc.phys=0x%08x, tx_status=%d, cookie=%d, residue=%d\n,
e1f7c9ee Ludovic Desroches 2014-10-22  931   __func__, desc, 
desc-tx_dma_desc.phys, ret, cookie, residue);
e1f7c9ee Ludovic Desroches 2014-10-22  932  
e1f7c9ee Ludovic Desroches 2014-10-22 @933  return ret;
e1f7c9ee Ludovic Desroches 2014-10-22  934  }
e1f7c9ee Ludovic Desroches 2014-10-22  935  
e1f7c9ee Ludovic Desroches 2014-10-22  936  /* Call must be protected by lock. 
*/
e1f7c9ee Ludovic Desroches 2014-10-22  937  static void 
at_xdmac_remove_xfer(struct at_xdmac_chan *atchan,
e1f7c9ee Ludovic Desroches 2014-10-22  938  
struct at_xdmac_desc *desc)
e1f7c9ee Ludovic Desroches 2014-10-22  939  {
e1f7c9ee Ludovic Desroches 2014-10-22  940  
dev_dbg(chan2dev(atchan-chan), %s: desc 0x%p\n, __func__, desc);
e1f7c9ee Ludovic Desroches 2014-10-22  941  

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 5753/6487] drivers/spi/spidev.c:583 spidev_release() warn: variable dereferenced before check 'spidev-spi' (see line 579)

2014-11-13 Thread Dan Carpenter
I reported this one earlier.

regards,
dan carpenter

On Thu, Nov 13, 2014 at 04:24:12PM +0800, kbuild test robot wrote:
 TO: Mark Brown broo...@kernel.org
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
 master
 head:   bbdef57970d5e1887de755474ff1562baa17ef11
 commit: 9169051617df7fca597274e9e43324332cb8f0ee [5753/6487] spi: spidev: 
 Don't mangle max_speed_hz in underlying spi device
 :: branch date: 80 minutes ago
 :: commit date: 2 days ago
 
 drivers/spi/spidev.c:583 spidev_release() warn: variable dereferenced before 
 check 'spidev-spi' (see line 579)
 
 git remote add next 
 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
 git remote update next
 git checkout 9169051617df7fca597274e9e43324332cb8f0ee
 vim +583 drivers/spi/spidev.c
 
 865f6d19 Ray Jui2014-10-09  573   
 kfree(spidev-tx_buffer);
 865f6d19 Ray Jui2014-10-09  574   spidev-tx_buffer = 
 NULL;
 865f6d19 Ray Jui2014-10-09  575  
 865f6d19 Ray Jui2014-10-09  576   
 kfree(spidev-rx_buffer);
 865f6d19 Ray Jui2014-10-09  577   spidev-rx_buffer = 
 NULL;
 b2c8dadd David Brownell 2008-06-05  578  
 91690516 Mark Brown 2014-11-08 @579   spidev-speed_hz = 
 spidev-spi-max_speed_hz;
 91690516 Mark Brown 2014-11-08  580  
 b2c8dadd David Brownell 2008-06-05  581   /* ... after we unbound 
 from the underlying device? */
 b2c8dadd David Brownell 2008-06-05  582   
 spin_lock_irq(spidev-spi_lock);
 b2c8dadd David Brownell 2008-06-05 @583   dofree = (spidev-spi 
 == NULL);
 b2c8dadd David Brownell 2008-06-05  584   
 spin_unlock_irq(spidev-spi_lock);
 b2c8dadd David Brownell 2008-06-05  585  
 b2c8dadd David Brownell 2008-06-05  586   if (dofree)
 
 :: The code at line 583 was first introduced by commit
 :: b2c8daddcbe03a22402ecf943bb88302601c6835 spi: fix refcount-related 
 spidev oops-on-rmmod
 
 :: TO: David Brownell dbrown...@users.sourceforge.net
 :: CC: Linus Torvalds torva...@linux-foundation.org
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] fs/overlayfs/super.c:367 ovl_lookup() error: passing non negative 2147383647 to ERR_PTR

2014-11-13 Thread Dan Carpenter
I see you have upgraded to the latest and greatest version of Smatch.
:)

This one is a false positive, though, sorry for that.  I'm not sure how
it gets triggered and I can't reproduce it on my end.

2147383647 is a magic number which means approximately the highest valid
pointer on 32 bit systems.  I'll keep on messing with it though to see
if I can figure out how this happened.

regards,
dan carpenter

On Thu, Nov 13, 2014 at 06:15:28AM +0800, kbuild test robot wrote:
 TO: Miklos Szeredi mszer...@suse.cz
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
 master
 head:   206c5f60a3d902bc4b56dab2de3e88de5eb06108
 commit: e9be9d5e76e34872f0c37d72e25bc27fe9e2c54c overlay filesystem
 date:   3 weeks ago
 :: branch date: 3 days ago
 :: commit date: 3 weeks ago
 
 fs/overlayfs/super.c:367 ovl_lookup() error: passing non negative 2147383647 
 to ERR_PTR
 fs/overlayfs/dir.c:284 ovl_clear_empty() error: passing non negative 
 2147383647 to ERR_PTR
 
 git remote add linus 
 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 git remote update linus
 git checkout e9be9d5e76e34872f0c37d72e25bc27fe9e2c54c
 vim +367 fs/overlayfs/super.c
 
 e9be9d5e Miklos Szeredi 2014-10-24  351  
 e9be9d5e Miklos Szeredi 2014-10-24  352   oe-__upperdentry = upperdentry;
 e9be9d5e Miklos Szeredi 2014-10-24  353   oe-lowerdentry = lowerdentry;
 e9be9d5e Miklos Szeredi 2014-10-24  354  
 e9be9d5e Miklos Szeredi 2014-10-24  355   dentry-d_fsdata = oe;
 e9be9d5e Miklos Szeredi 2014-10-24  356   d_add(dentry, inode);
 e9be9d5e Miklos Szeredi 2014-10-24  357  
 e9be9d5e Miklos Szeredi 2014-10-24  358   return NULL;
 e9be9d5e Miklos Szeredi 2014-10-24  359  
 e9be9d5e Miklos Szeredi 2014-10-24  360  out_dput:
 e9be9d5e Miklos Szeredi 2014-10-24  361   dput(lowerdentry);
 e9be9d5e Miklos Szeredi 2014-10-24  362  out_dput_upper:
 e9be9d5e Miklos Szeredi 2014-10-24  363   dput(upperdentry);
 e9be9d5e Miklos Szeredi 2014-10-24  364  out_put_dir:
 e9be9d5e Miklos Szeredi 2014-10-24  365   kfree(oe);
 e9be9d5e Miklos Szeredi 2014-10-24  366  out:
 e9be9d5e Miklos Szeredi 2014-10-24 @367   return ERR_PTR(err);
 e9be9d5e Miklos Szeredi 2014-10-24  368  }
 e9be9d5e Miklos Szeredi 2014-10-24  369  
 e9be9d5e Miklos Szeredi 2014-10-24  370  struct file *ovl_path_open(struct 
 path *path, int flags)
 e9be9d5e Miklos Szeredi 2014-10-24  371  {
 e9be9d5e Miklos Szeredi 2014-10-24  372   return dentry_open(path, flags, 
 current_cred());
 e9be9d5e Miklos Szeredi 2014-10-24  373  }
 e9be9d5e Miklos Szeredi 2014-10-24  374  
 e9be9d5e Miklos Szeredi 2014-10-24  375  static void ovl_put_super(struct 
 super_block *sb)
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] fs/overlayfs/super.c:367 ovl_lookup() error: passing non negative 2147383647 to ERR_PTR

2014-11-13 Thread Dan Carpenter
On Thu, Nov 13, 2014 at 08:22:21PM +0800, Fengguang Wu wrote:
 No problem.  From now on the smatch I run here should be auto upgraded
 to your latest git HEAD. :)

Oh wow...  That's a lot of presure and I've traditionally sucked at QC.

Right now, I feel like Smatch is at a stable place.  I guess we'll see
how that goes and I will try to be careful.  :)

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [PATCH] iio: adc: fix platform_no_drv_owner.cocci warnings (fwd)

2014-11-13 Thread Dan Carpenter
On Thu, Nov 13, 2014 at 08:23:36PM +0800, Fengguang Wu wrote:
 Hi Julia,
 
 On Thu, Nov 13, 2014 at 11:26:23AM +0100, Julia Lawall wrote:
  Is there any way that we can improve this process?  At the moment, I just
  take the message I get and forward it.
 

I normally forward bug warnings if I read it before you.

These patches are a pain for me to forward because the patch is an
attachment and I have to edit them to change the signed off by and all.

Also I feel like the simple_return.cocci are pretty high confidence so
they could be sent automatically.  Julia, what do you think?

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [PATCH] iio: adc: fix platform_no_drv_owner.cocci warnings (fwd)

2014-11-13 Thread Dan Carpenter
On Thu, Nov 13, 2014 at 01:45:39PM +0100, Julia Lawall wrote:
 But overall the problem is for the lower confidence ones how to get the
 patch to the developer in the form that they want.  Is the idea that there
 are some lines that I should be removing (To, CC, and the file and line
 generated by Coccinelle)?  Should I forward instead of replying?

Fengguang and I use mutt.  In mutt you can just edit the original
message, change the from and to headers, chop out the meta comments
about when the code was committed and resend.

That's much more awkward for non mutt users though...

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [PATCH] iio: adc: fix platform_no_drv_owner.cocci warnings (fwd)

2014-11-13 Thread Dan Carpenter
On Thu, Nov 13, 2014 at 09:20:16PM +0800, Fengguang Wu wrote:
 I'm a robot, after all. ;)

Heh.  One time I was credited to as:

Reported-by: The Intel Backend

And I had to tell them that I might be a backend, but I work for Oracle.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [next:master 125/6487] drivers/net/wireless/ath/ath10k/wmi.c:3170 ath10k_wmi_start_scan_verify() warn: this array is probably non-NULL. 'arg-ie'

2014-11-13 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   bbdef57970d5e1887de755474ff1562baa17ef11
commit: a6aa5da3029670816b3eb9358bc1a63f2e2564fb [125/6487] ath10k: re-work 
scan start command building

drivers/net/wireless/ath/ath10k/wmi.c:3170 ath10k_wmi_start_scan_verify() warn: 
this array is probably non-NULL. 'arg-ie'
drivers/net/wireless/ath/ath10k/wmi.c:3172 ath10k_wmi_start_scan_verify() warn: 
this array is probably non-NULL. 'arg-channels'
drivers/net/wireless/ath/ath10k/wmi.c:3174 ath10k_wmi_start_scan_verify() warn: 
this array is probably non-NULL. 'arg-ssids'
drivers/net/wireless/ath/ath10k/wmi.c:3176 ath10k_wmi_start_scan_verify() warn: 
this array is probably non-NULL. 'arg-bssids'

git remote add next 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout a6aa5da3029670816b3eb9358bc1a63f2e2564fb
vim +3170 drivers/net/wireless/ath/ath10k/wmi.c

12b2b9e3 Bartosz Markowski 2013-09-26  3164  
12b2b9e3 Bartosz Markowski 2013-09-26  3165 return ret;
12b2b9e3 Bartosz Markowski 2013-09-26  3166  }
12b2b9e3 Bartosz Markowski 2013-09-26  3167  
a6aa5da3 Michal Kazior 2014-09-18  3168  static int 
ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg)
5e3dd157 Kalle Valo2013-06-12  3169  {
a6aa5da3 Michal Kazior 2014-09-18 @3170 if (arg-ie_len  !arg-ie)
a6aa5da3 Michal Kazior 2014-09-18  3171 return -EINVAL;
a6aa5da3 Michal Kazior 2014-09-18 @3172 if (arg-n_channels  
!arg-channels)
a6aa5da3 Michal Kazior 2014-09-18  3173 return -EINVAL;
a6aa5da3 Michal Kazior 2014-09-18 @3174 if (arg-n_ssids  !arg-ssids)
5e3dd157 Kalle Valo2013-06-12  3175 return -EINVAL;
a6aa5da3 Michal Kazior 2014-09-18 @3176 if (arg-n_bssids  
!arg-bssids)
a6aa5da3 Michal Kazior 2014-09-18  3177 return -EINVAL;
a6aa5da3 Michal Kazior 2014-09-18  3178  
5e3dd157 Kalle Valo2013-06-12  3179 if (arg-ie_len  
WLAN_SCAN_PARAMS_MAX_IE_LEN)

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 2788/6487] drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c:1073 brcmf_ops_sdio_probe() error: we previously assumed 'sdiodev-pdata' could be null (see line 1064)

2014-11-13 Thread Dan Carpenter
I reported this one earlier.

regards,
dan carpenter

On Thu, Nov 13, 2014 at 10:08:36PM +0800, kbuild test robot wrote:
 TO: Hante Meuleman meule...@broadcom.com
 CC: John W. Linville linvi...@tuxdriver.com
 CC: Arend van Spriel ar...@broadcom.com
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
 master
 head:   bbdef57970d5e1887de755474ff1562baa17ef11
 commit: 330b4e4be937bf0ef126e01323f2756645b92c06 [2788/6487] brcmfmac: Add 
 wowl support for SDIO devices.
 :: branch date: 7 hours ago
 :: commit date: 2 weeks ago
 
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c:1073 brcmf_ops_sdio_probe() 
 error: we previously assumed 'sdiodev-pdata' could be null (see line 1064)
 
 git remote add next 
 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
 git remote update next
 git checkout 330b4e4be937bf0ef126e01323f2756645b92c06
 vim +1073 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
 
 943258b6 Hante Meuleman   2013-12-12  1058bus_if-proto_type = 
 BRCMF_PROTO_BCDC;
 e2dc9eea Arend van Spriel 2013-12-12  1059dev_set_drvdata(func-dev, 
 bus_if);
 e2dc9eea Arend van Spriel 2013-12-12  1060
 dev_set_drvdata(sdiodev-func[1]-dev, bus_if);
 e2dc9eea Arend van Spriel 2013-12-12  1061sdiodev-dev = 
 sdiodev-func[1]-dev;
 e2dc9eea Arend van Spriel 2013-12-12  1062sdiodev-pdata = 
 brcmfmac_sdio_pdata;
 e2dc9eea Arend van Spriel 2013-12-12  1063  
 61f663df Chen-Yu Tsai 2014-06-29 @1064if (!sdiodev-pdata)
 61f663df Chen-Yu Tsai 2014-06-29  1065brcmf_of_probe(sdiodev);
 61f663df Chen-Yu Tsai 2014-06-29  1066  
 330b4e4b Hante Meuleman   2014-10-28  1067  #ifdef CONFIG_PM_SLEEP
 330b4e4b Hante Meuleman   2014-10-28  1068/* wowl can be supported when 
 KEEP_POWER is true and (WAKE_SDIO_IRQ
 330b4e4b Hante Meuleman   2014-10-28  1069 * is true or when platform 
 data OOB irq is true).
 330b4e4b Hante Meuleman   2014-10-28  1070 */
 330b4e4b Hante Meuleman   2014-10-28  1071if 
 ((sdio_get_host_pm_caps(sdiodev-func[1])  MMC_PM_KEEP_POWER) 
 330b4e4b Hante Meuleman   2014-10-28  1072
 ((sdio_get_host_pm_caps(sdiodev-func[1])  MMC_PM_WAKE_SDIO_IRQ) ||
 330b4e4b Hante Meuleman   2014-10-28 @1073 
 (sdiodev-pdata-oob_irq_supported)))
 330b4e4b Hante Meuleman   2014-10-28  1074bus_if-wowl_supported 
 = true;
 330b4e4b Hante Meuleman   2014-10-28  1075  #endif
 330b4e4b Hante Meuleman   2014-10-28  1076  
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 200/6487] drivers/net/wireless/ath/ath10k/debug.c:1195 ath10k_debug_get_et_strings() error: __builtin_memcpy() '*ath10k_gstrings_stats' too small (32 vs 1472)

2014-11-13 Thread Dan Carpenter
This one is sort of a false positive.  The code works.  I feel like it
should be written:

memcpy(data, ath10k_gstrings_stats, sizeof(ath10k_gstrings_stats));

But that's a style issue rather than a bug.

regards,
dan carpenter

On Thu, Nov 13, 2014 at 10:04:33PM +0800, kbuild test robot wrote:
 TO: Ben Greear gree...@candelatech.com
 CC: Kalle Valo kv...@adurom.com
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
 master
 head:   bbdef57970d5e1887de755474ff1562baa17ef11
 commit: 6cddcc7ac215a3e988ec2cbf303fb0a39220dc3b [200/6487] ath10k: support 
 ethtool stats
 :: branch date: 7 hours ago
 :: commit date: 6 weeks ago
 
 drivers/net/wireless/ath/ath10k/debug.c:1195 ath10k_debug_get_et_strings() 
 error: __builtin_memcpy() '*ath10k_gstrings_stats' too small (32 vs 1472)
 
 git remote add next 
 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
 git remote update next
 git checkout 6cddcc7ac215a3e988ec2cbf303fb0a39220dc3b
 vim +1195 drivers/net/wireless/ath/ath10k/debug.c
 
 6cddcc7a Ben Greear 2014-09-29  1179  d_rx_mpdu_stack,
 6cddcc7a Ben Greear 2014-09-29  1180  d_rx_phy_err,
 6cddcc7a Ben Greear 2014-09-29  1181  d_rx_phy_err_drops,
 6cddcc7a Ben Greear 2014-09-29  1182  d_rx_mpdu_errors, /* FCS, 
 MIC, ENC */
 6cddcc7a Ben Greear 2014-09-29  1183  d_fw_crash_count,
 6cddcc7a Ben Greear 2014-09-29  1184  d_fw_warm_reset_count,
 6cddcc7a Ben Greear 2014-09-29  1185  d_fw_cold_reset_count,
 6cddcc7a Ben Greear 2014-09-29  1186  };
 6cddcc7a Ben Greear 2014-09-29  1187  
 6cddcc7a Ben Greear 2014-09-29  1188  #define ATH10K_SSTATS_LEN 
 ARRAY_SIZE(ath10k_gstrings_stats)
 6cddcc7a Ben Greear 2014-09-29  1189  
 6cddcc7a Ben Greear 2014-09-29  1190  void ath10k_debug_get_et_strings(struct 
 ieee80211_hw *hw,
 6cddcc7a Ben Greear 2014-09-29  1191   struct 
 ieee80211_vif *vif,
 6cddcc7a Ben Greear 2014-09-29  1192   u32 
 sset, u8 *data)
 6cddcc7a Ben Greear 2014-09-29  1193  {
 6cddcc7a Ben Greear 2014-09-29  1194  if (sset == ETH_SS_STATS)
 6cddcc7a Ben Greear 2014-09-29 @1195  memcpy(data, 
 *ath10k_gstrings_stats,
 6cddcc7a Ben Greear 2014-09-29  1196 
 sizeof(ath10k_gstrings_stats));
 6cddcc7a Ben Greear 2014-09-29  1197  }
 6cddcc7a Ben Greear 2014-09-29  1198  
 6cddcc7a Ben Greear 2014-09-29  1199  int 
 ath10k_debug_get_et_sset_count(struct ieee80211_hw *hw,
 6cddcc7a Ben Greear 2014-09-29  1200 
 struct ieee80211_vif *vif, int sset)
 6cddcc7a Ben Greear 2014-09-29  1201  {
 6cddcc7a Ben Greear 2014-09-29  1202  if (sset == ETH_SS_STATS)
 6cddcc7a Ben Greear 2014-09-29  1203  return 
 ATH10K_SSTATS_LEN;
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 1093/6788] net/mac80211/rc80211_minstrel_ht.c:255 minstrel_ht_sort_best_tp_rates() error: buffer overflow 'tp_list' 2 = 3

2014-11-17 Thread Dan Carpenter
On Mon, Nov 17, 2014 at 06:23:58PM +0800, Fengguang Wu wrote:
 On Mon, Nov 17, 2014 at 12:56:08PM +0300, Dan Carpenter wrote:
  On Mon, Nov 17, 2014 at 05:32:33PM +0800, Fengguang Wu wrote:
   On Mon, Nov 17, 2014 at 11:36:37AM +0300, Dan Carpenter wrote:
Fengguang, this seems to be a very old version of linux-next?
   
   It's 3 days ago, the HEAD commit is
   
   commit d7e5a72b951a4ef6d97b2aa43cad37f237ba8030
   Author: Stephen Rothwell s...@canb.auug.org.au
   AuthorDate: Fri Nov 14 19:23:08 2014 +1100
   Commit: Stephen Rothwell s...@canb.auug.org.au
   CommitDate: Fri Nov 14 19:23:08 2014 +1100
   
   Add linux-next specific files for 20141114
   
   Signed-off-by: Stephen Rothwell s...@canb.auug.org.au
  
  
  The line numbers match.  It has to be next-20141104 or earlier (one
  month ago).
 
 Yes the commit d4d141cae804a430054f4138fa177229114f203a is one month
 ago. The context source code is using output of that commit:
 
 git show 
 d4d141cae804a430054f4138fa177229114f203a:net/mac80211/rc80211_minstrel_ht.c

Ah.  Gotcha.  Thanks.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [ath6kl:ath-next-test 10/13] drivers/net/wireless/ath/ath10k/debug.c:1100 ath10k_mem_value_write() warn: maybe return -EFAULT instead of the bytes remaining?

2014-11-24 Thread Dan Carpenter
tree:   git://github.com/kvalo/ath ath-next-test
head:   acb3cfda39e56f641e0d84fdea04c290c107c36d
commit: ab39b15d893c9b77389d452bcd57d8ff9875032c [10/13] ath10k: Add the target 
register access and memory dump debugfs interface

New smatch warnings:
drivers/net/wireless/ath/ath10k/debug.c:1100 ath10k_mem_value_write() warn: 
maybe return -EFAULT instead of the bytes remaining?

git remote add ath6kl git://github.com/kvalo/ath
git remote update ath6kl
git checkout ab39b15d893c9b77389d452bcd57d8ff9875032c
vim +1100 drivers/net/wireless/ath/ath10k/debug.c

ab39b15d Yanbo Li 2014-11-22  1084  ret = copy_from_user(buf, user_buf, 
count);
ab39b15d Yanbo Li 2014-11-22  1085  if (ret)
ab39b15d Yanbo Li 2014-11-22  1086  goto err_free_copy;
ab39b15d Yanbo Li 2014-11-22  1087  
ab39b15d Yanbo Li 2014-11-22  1088  ret = ath10k_hif_diag_write(ar, *ppos, 
buf, count);
ab39b15d Yanbo Li 2014-11-22  1089  if (ret) {
ab39b15d Yanbo Li 2014-11-22  1090  ath10k_warn(ar, failed to 
write address 0x%08x via diagnose window from debugfs: %d\n,
ab39b15d Yanbo Li 2014-11-22  1091  (u32)(*ppos), ret);
ab39b15d Yanbo Li 2014-11-22  1092  goto err_free_copy;
ab39b15d Yanbo Li 2014-11-22  1093  }
ab39b15d Yanbo Li 2014-11-22  1094  
ab39b15d Yanbo Li 2014-11-22  1095  *ppos += count;
ab39b15d Yanbo Li 2014-11-22  1096  ret = count;
ab39b15d Yanbo Li 2014-11-22  1097  
ab39b15d Yanbo Li 2014-11-22  1098  err_free_copy:
ab39b15d Yanbo Li 2014-11-22  1099  vfree(buf);
ab39b15d Yanbo Li 2014-11-22 @1100  return ret;
ab39b15d Yanbo Li 2014-11-22  1101  }
ab39b15d Yanbo Li 2014-11-22  1102  
ab39b15d Yanbo Li 2014-11-22  1103  static const struct file_operations 
fops_mem_value = {
ab39b15d Yanbo Li 2014-11-22  1104  .read = ath10k_mem_value_read,
ab39b15d Yanbo Li 2014-11-22  1105  .write = ath10k_mem_value_write,
ab39b15d Yanbo Li 2014-11-22  1106  .open = simple_open,
ab39b15d Yanbo Li 2014-11-22  1107  .owner = THIS_MODULE,
ab39b15d Yanbo Li 2014-11-22  1108  .llseek = default_llseek,

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [ux500:tb-st-spi 4/7] drivers/nfc/st95hf/st95hf.c:669 st95hf_irq_handler() error: we previously assumed 'stcontext' could be null (see line 665)

2014-11-24 Thread Dan Carpenter
It's bad code, but it's deliberate.

regards,
dan carpenter

On Fri, Nov 21, 2014 at 02:57:03AM +0800, kbuild test robot wrote:
 TO: Lee Jones lee.jo...@linaro.org
 
 tree:   https://git.linaro.org/people/ljones/linux-3.0-ux500.git tb-st-spi
 head:   d83034f9b016df748567f53725f20124453eecbb
 commit: 6b65728d00fda39d1abfd8319a135baec25b9218 [4/7] stuff
 :: branch date: 3 hours ago
 :: commit date: 4 hours ago
 
 drivers/nfc/st95hf/st95hf.c:669 st95hf_irq_handler() error: we previously 
 assumed 'stcontext' could be null (see line 665)
 drivers/nfc/st95hf/st95hf.c:696 st95hf_irq_thread_handler() error: we 
 previously assumed 'stcontext' could be null (see line 692)
 drivers/nfc/st95hf/st95hf.c:700 st95hf_irq_thread_handler() error: we 
 previously assumed 'stcontext-nfcdev' could be null (see line 696)
 drivers/nfc/st95hf/st95hf.c:1134 st95hf_probe() warn: unsigned 
 'st95context-st95hf_enable_gpio' is never less than zero.
 
 git remote add ux500 https://git.linaro.org/people/ljones/linux-3.0-ux500.git
 git remote update ux500
 git checkout 6b65728d00fda39d1abfd8319a135baec25b9218
 vim +/stcontext +669 drivers/nfc/st95hf/st95hf.c
 
 6b65728d Lee Jones 2014-11-20  659  {
 6b65728d Lee Jones 2014-11-20  660struct st95hf_context *stcontext  =
 6b65728d Lee Jones 2014-11-20  661(struct st95hf_context 
 *)st95hfcontext;
 6b65728d Lee Jones 2014-11-20  662  
 6b65728d Lee Jones 2014-11-20  663//printk(LEE: %s: %s()[%d]: \n, 
 __FILE__, __func__, __LINE__);
 6b65728d Lee Jones 2014-11-20  664  
 6b65728d Lee Jones 2014-11-20 @665if (!stcontext)
 6b65728d Lee Jones 2014-11-20  666printk(LEE: %s: %s()[%d]: 
 ERR1\n,
 6b65728d Lee Jones 2014-11-20  667   __FILE__, __func__, 
 __LINE__);
 6b65728d Lee Jones 2014-11-20  668  
 6b65728d Lee Jones 2014-11-20 @669if (stcontext-spicontext.req_issync) {
 6b65728d Lee Jones 2014-11-20  670
 stcontext-spicontext.reply_from_st95 = 1;
 6b65728d Lee Jones 2014-11-20  671
 wake_up_interruptible(stcontext-spicontext.st95wait_queue);
 6b65728d Lee Jones 2014-11-20  672return IRQ_HANDLED;
 6b65728d Lee Jones 2014-11-20  673}
 6b65728d Lee Jones 2014-11-20  674  
 6b65728d Lee Jones 2014-11-20  675return IRQ_WAKE_THREAD;
 6b65728d Lee Jones 2014-11-20  676  }
 6b65728d Lee Jones 2014-11-20  677  
 6b65728d Lee Jones 2014-11-20  678  static irqreturn_t 
 st95hf_irq_thread_handler(int irq, void  *st95hfcontext)
 6b65728d Lee Jones 2014-11-20  679  {
 6b65728d Lee Jones 2014-11-20  680//printk(LEE: %s: %s()[%d]: \n, 
 __FILE__, __func__, __LINE__);
 6b65728d Lee Jones 2014-11-20  681  
 6b65728d Lee Jones 2014-11-20  682int result;
 6b65728d Lee Jones 2014-11-20  683int current_len;
 6b65728d Lee Jones 2014-11-20  684unsigned char 
 idle_cmd_response[CMD_IDLE_TAGDETECT_RES_LEN];
 6b65728d Lee Jones 2014-11-20  685int res_len = 0;
 6b65728d Lee Jones 2014-11-20  686struct nfc_target nfctarget;
 6b65728d Lee Jones 2014-11-20  687struct st95hf_context *stcontext  =
 6b65728d Lee Jones 2014-11-20  688(struct st95hf_context 
 *)st95hfcontext;
 6b65728d Lee Jones 2014-11-20  689struct device nfc_device;
 6b65728d Lee Jones 2014-11-20  690struct st95_data_exchange_arg 
 *data_ex_arg;
 6b65728d Lee Jones 2014-11-20  691  
 6b65728d Lee Jones 2014-11-20 @692if (!stcontext)
 6b65728d Lee Jones 2014-11-20  693printk(LEE: %s: %s()[%d]: 
 ERR1\n,
 6b65728d Lee Jones 2014-11-20  694   __FILE__, __func__, 
 __LINE__);
 6b65728d Lee Jones 2014-11-20  695  
 6b65728d Lee Jones 2014-11-20 @696if (!stcontext-nfcdev)
 6b65728d Lee Jones 2014-11-20  697printk(LEE: %s: %s()[%d]: 
 ERR2\n,
 6b65728d Lee Jones 2014-11-20  698   __FILE__, __func__, 
 __LINE__);
 6b65728d Lee Jones 2014-11-20  699  
 6b65728d Lee Jones 2014-11-20 @700nfc_device = stcontext-nfcdev-dev;
 6b65728d Lee Jones 2014-11-20  701  
 6b65728d Lee Jones 2014-11-20  702data_ex_arg = stcontext-data_ex_arg;
 6b65728d Lee Jones 2014-11-20  703memset(nfctarget, 0, sizeof(struct 
 nfc_target));
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [dhowells-fs:modsign-pkcs7 2/5] crypto/asymmetric_keys/x509_public_key.c:119 x509_request_asymmetric_key() warn: variable dereferenced before check 'id' (see line 75)

2014-11-24 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs 
modsign-pkcs7
head:   e74cbea099d4753be170c746e93f7a3587c4f02d
commit: 7087c095c7ecc4eebcd4acfd36a7752e5339d026 [2/5] X.509: Support X.509 
lookup by Issuer+Serial form AuthorityKeyIdentifier

crypto/asymmetric_keys/x509_public_key.c:119 x509_request_asymmetric_key() 
warn: variable dereferenced before check 'id' (see line 75)

git remote add dhowells-fs 
git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
git remote update dhowells-fs
git checkout 7087c095c7ecc4eebcd4acfd36a7752e5339d026
vim +/id +119 crypto/asymmetric_keys/x509_public_key.c

7087c095 David Howells   2014-11-20   69struct key *key;
7087c095 David Howells   2014-11-20   70key_ref_t ref;
7087c095 David Howells   2014-11-20   71const char *lookup;
7087c095 David Howells   2014-11-20   72char *req, *p;
7087c095 David Howells   2014-11-20   73int len;
7087c095 David Howells   2014-11-20   74  
7087c095 David Howells   2014-11-20  @75lookup = id-data;
7087c095 David Howells   2014-11-20   76len = id-len;
7087c095 David Howells   2014-11-20   77if (!lookup) {
7087c095 David Howells   2014-11-20   78lookup = skid-data;
7087c095 David Howells   2014-11-20   79len = skid-len;
7087c095 David Howells   2014-11-20   80}
3be4beaf Mimi Zohar  2013-08-20   81
46963b77 David Howells   2014-09-16   82/* Construct an identifier 
id:keyid. */
7087c095 David Howells   2014-11-20   83p = req = kmalloc(2 + 1 + len * 
2 + 1, GFP_KERNEL);
7087c095 David Howells   2014-11-20   84if (!req)
3be4beaf Mimi Zohar  2013-08-20   85return ERR_PTR(-ENOMEM);
3be4beaf Mimi Zohar  2013-08-20   86  
f1b731db Dmitry Kasatkin 2014-10-06   87if (partial) {
46963b77 David Howells   2014-09-16   88*p++ = 'i';
46963b77 David Howells   2014-09-16   89*p++ = 'd';
f1b731db Dmitry Kasatkin 2014-10-06   90} else {
f1b731db Dmitry Kasatkin 2014-10-06   91*p++ = 'e';
f1b731db Dmitry Kasatkin 2014-10-06   92*p++ = 'x';
f1b731db Dmitry Kasatkin 2014-10-06   93}
46963b77 David Howells   2014-09-16   94*p++ = ':';
7087c095 David Howells   2014-11-20   95p = bin2hex(p, lookup, len);
46963b77 David Howells   2014-09-16   96*p = 0;
3be4beaf Mimi Zohar  2013-08-20   97  
7087c095 David Howells   2014-11-20   98pr_debug(Look up: \%s\\n, 
req);
3be4beaf Mimi Zohar  2013-08-20   99  
7087c095 David Howells   2014-11-20  100ref = 
keyring_search(make_key_ref(keyring, 1),
7087c095 David Howells   2014-11-20  101 
key_type_asymmetric, req);
7087c095 David Howells   2014-11-20  102if (IS_ERR(ref))
7087c095 David Howells   2014-11-20  103pr_debug(Request for 
key '%s' err %ld\n, req, PTR_ERR(ref));
7087c095 David Howells   2014-11-20  104kfree(req);
3be4beaf Mimi Zohar  2013-08-20  105  
7087c095 David Howells   2014-11-20  106if (IS_ERR(ref)) {
7087c095 David Howells   2014-11-20  107switch (PTR_ERR(ref)) {
3be4beaf Mimi Zohar  2013-08-20  108/* Hide some 
search errors */
3be4beaf Mimi Zohar  2013-08-20  109case -EACCES:
3be4beaf Mimi Zohar  2013-08-20  110case -ENOTDIR:
3be4beaf Mimi Zohar  2013-08-20  111case -EAGAIN:
3be4beaf Mimi Zohar  2013-08-20  112return 
ERR_PTR(-ENOKEY);
3be4beaf Mimi Zohar  2013-08-20  113default:
7087c095 David Howells   2014-11-20  114return 
ERR_CAST(ref);
7087c095 David Howells   2014-11-20  115}
7087c095 David Howells   2014-11-20  116}
7087c095 David Howells   2014-11-20  117  
7087c095 David Howells   2014-11-20  118key = key_ref_to_ptr(ref);
7087c095 David Howells   2014-11-20 @119if (id  skid) {
7087c095 David Howells   2014-11-20  120const struct 
asymmetric_key_ids *kids = asymmetric_key_ids(key);
7087c095 David Howells   2014-11-20  121if (!kids-id[1]) {
7087c095 David Howells   2014-11-20  122
pr_debug(issuer+serial match, but expected SKID missing\n);

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [char-misc:kdbus 12/13] ipc/kdbus/handle.c:736 handle_ep_ioctl_connected() warn: maybe return -EFAULT instead of the bytes remaining?

2014-11-24 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git kdbus
head:   d064b29b452333d0e0ed6b9d2fc96b6e3917b1d7
commit: 0311aa1370e08cf0bf799a5f6e7ea29297cc3bdd [12/13] kdbus: add Makefile, 
Kconfig and MAINTAINERS entry

ipc/kdbus/handle.c:736 handle_ep_ioctl_connected() warn: maybe return -EFAULT 
instead of the bytes remaining?
ipc/kdbus/metadata.c:376 kdbus_meta_append_cmdline() warn: maybe return -EFAULT 
instead of the bytes remaining?

git remote add char-misc 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
git remote update char-misc
git checkout 0311aa1370e08cf0bf799a5f6e7ea29297cc3bdd
vim +736 ipc/kdbus/handle.c

97149087 Daniel Mack 2014-09-11  720ret = 
kdbus_negotiate_flags(cmd_free, buf, typeof(cmd_free),
97149087 Daniel Mack 2014-09-11  7210);
97149087 Daniel Mack 2014-09-11  722if (ret  0)
97149087 Daniel Mack 2014-09-11  723break;
97149087 Daniel Mack 2014-09-11  724  
97149087 Daniel Mack 2014-09-11  725ret = 
kdbus_pool_release_offset(conn-pool, cmd_free.offset);
97149087 Daniel Mack 2014-09-11  726break;
97149087 Daniel Mack 2014-09-11  727}
97149087 Daniel Mack 2014-09-11  728  
97149087 Daniel Mack 2014-09-11  729default:
97149087 Daniel Mack 2014-09-11  730ret = -ENOTTY;
97149087 Daniel Mack 2014-09-11  731break;
97149087 Daniel Mack 2014-09-11  732}
97149087 Daniel Mack 2014-09-11  733  
97149087 Daniel Mack 2014-09-11  734kdbus_conn_release(conn);
97149087 Daniel Mack 2014-09-11  735kfree(free_ptr);
97149087 Daniel Mack 2014-09-11 @736return ret;
97149087 Daniel Mack 2014-09-11  737  }
97149087 Daniel Mack 2014-09-11  738  
97149087 Daniel Mack 2014-09-11  739  /* kdbus endpoint commands for endpoint 
owners */
97149087 Daniel Mack 2014-09-11  740  static long handle_ep_ioctl_owner(struct 
file *file, unsigned int cmd,
97149087 Daniel Mack 2014-09-11  741  void __user 
*buf)
97149087 Daniel Mack 2014-09-11  742  {
97149087 Daniel Mack 2014-09-11  743struct kdbus_handle_ep *handle = 
file-private_data;
97149087 Daniel Mack 2014-09-11  744struct kdbus_ep *ep = handle-ep_owner;

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [asoc:topic/intel 61/64] sound/soc/intel/sst/sst_acpi.c:228 sst_acpi_find_machine() warn: this array is probably non-NULL. 'mach-codec_id'

2014-11-24 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 
topic/intel
head:   996cc8494d663cb03c5ec23ced0e09e4bcd845de
commit: 336cfbb05edf7b122ea927dad6c746608723eb25 [61/64] ASoC: Intel: mrfld- 
add ACPI module

sound/soc/intel/sst/sst_acpi.c:228 sst_acpi_find_machine() warn: this array is 
probably non-NULL. 'mach-codec_id'
sound/soc/intel/sst/sst_acpi.c:228 sst_acpi_find_machine() warn: this array is 
probably non-NULL. 'mach-codec_id'
sound/soc/intel/sst/sst_acpi.c:287 sst_acpi_probe() error: strcpy() 
'mach-firmware' too large for 'ctx-firmware_name' (32 vs 20)

git remote add asoc 
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
git remote update asoc
git checkout 336cfbb05edf7b122ea927dad6c746608723eb25
vim +228 sound/soc/intel/sst/sst_acpi.c

336cfbb0 Vinod Koul 2014-11-11  222  static struct sst_machines 
*sst_acpi_find_machine(
336cfbb0 Vinod Koul 2014-11-11  223 struct sst_machines *machines)
336cfbb0 Vinod Koul 2014-11-11  224  {
336cfbb0 Vinod Koul 2014-11-11  225 struct sst_machines *mach;
336cfbb0 Vinod Koul 2014-11-11  226 bool found = false;
336cfbb0 Vinod Koul 2014-11-11  227  
336cfbb0 Vinod Koul 2014-11-11 @228 for (mach = machines; mach-codec_id; 
mach++)
336cfbb0 Vinod Koul 2014-11-11  229 if 
(ACPI_SUCCESS(acpi_get_devices(mach-codec_id,
336cfbb0 Vinod Koul 2014-11-11  230 
  sst_acpi_mach_match,
336cfbb0 Vinod Koul 2014-11-11  231 
  found, NULL))  found)
336cfbb0 Vinod Koul 2014-11-11  232 return mach;
336cfbb0 Vinod Koul 2014-11-11  233  
336cfbb0 Vinod Koul 2014-11-11  234 return NULL;
336cfbb0 Vinod Koul 2014-11-11  235  }
336cfbb0 Vinod Koul 2014-11-11  236  
336cfbb0 Vinod Koul 2014-11-11  237  int sst_acpi_probe(struct platform_device 
*pdev)
336cfbb0 Vinod Koul 2014-11-11  238  {
336cfbb0 Vinod Koul 2014-11-11  239 struct device *dev = pdev-dev;
336cfbb0 Vinod Koul 2014-11-11  240 int ret = 0;
336cfbb0 Vinod Koul 2014-11-11  241 struct intel_sst_drv *ctx;
336cfbb0 Vinod Koul 2014-11-11  242 const struct acpi_device_id *id;
336cfbb0 Vinod Koul 2014-11-11  243 struct sst_machines *mach;
336cfbb0 Vinod Koul 2014-11-11  244 struct platform_device *mdev;
336cfbb0 Vinod Koul 2014-11-11  245 struct platform_device *plat_dev;
336cfbb0 Vinod Koul 2014-11-11  246 unsigned int dev_id;
336cfbb0 Vinod Koul 2014-11-11  247  
336cfbb0 Vinod Koul 2014-11-11  248 id = 
acpi_match_device(dev-driver-acpi_match_table, dev);
336cfbb0 Vinod Koul 2014-11-11  249 if (!id)
336cfbb0 Vinod Koul 2014-11-11  250 return -ENODEV;
336cfbb0 Vinod Koul 2014-11-11  251 dev_dbg(dev, for %s, id-id);
336cfbb0 Vinod Koul 2014-11-11  252  
336cfbb0 Vinod Koul 2014-11-11  253 mach = (struct sst_machines 
*)id-driver_data;
336cfbb0 Vinod Koul 2014-11-11  254 mach = sst_acpi_find_machine(mach);
336cfbb0 Vinod Koul 2014-11-11  255 if (mach == NULL) {
336cfbb0 Vinod Koul 2014-11-11  256 dev_err(dev, No matching 
machine driver found\n);
336cfbb0 Vinod Koul 2014-11-11  257 return -ENODEV;
336cfbb0 Vinod Koul 2014-11-11  258 }
336cfbb0 Vinod Koul 2014-11-11  259  
336cfbb0 Vinod Koul 2014-11-11  260 ret = kstrtouint(id-id, 16, dev_id);
336cfbb0 Vinod Koul 2014-11-11  261 if (ret  0) {
336cfbb0 Vinod Koul 2014-11-11  262 dev_err(dev, Unique device id 
conversion error: %d\n, ret);
336cfbb0 Vinod Koul 2014-11-11  263 return ret;
336cfbb0 Vinod Koul 2014-11-11  264 }
336cfbb0 Vinod Koul 2014-11-11  265  
336cfbb0 Vinod Koul 2014-11-11  266 dev_dbg(dev, ACPI device id: %x\n, 
dev_id);
336cfbb0 Vinod Koul 2014-11-11  267  
336cfbb0 Vinod Koul 2014-11-11  268 plat_dev = 
platform_device_register_data(dev, mach-pdata-platform, -1, NULL, 0);
336cfbb0 Vinod Koul 2014-11-11  269 if (plat_dev == NULL) {
336cfbb0 Vinod Koul 2014-11-11  270 dev_err(dev, Failed to create 
machine device: %s\n, mach-pdata-platform);
336cfbb0 Vinod Koul 2014-11-11  271 return -ENODEV;
336cfbb0 Vinod Koul 2014-11-11  272 }
336cfbb0 Vinod Koul 2014-11-11  273  
336cfbb0 Vinod Koul 2014-11-11  274 /* Create platform device for sst 
machine driver */
336cfbb0 Vinod Koul 2014-11-11  275 mdev = 
platform_device_register_data(dev, mach-machine, -1, NULL, 0);
336cfbb0 Vinod Koul 2014-11-11  276 if (mdev == NULL) {
336cfbb0 Vinod Koul 2014-11-11  277 dev_err(dev, Failed to create 
machine device: %s\n, mach-machine);
336cfbb0 Vinod Koul 2014-11-11  278 return -ENODEV;
336cfbb0 Vinod Koul 2014-11-11  279 }
336cfbb0 Vinod Koul 2014-11-11  280  
336cfbb0 Vinod Koul 2014-11-11  281 ret = sst_alloc_drv_context(ctx, dev, 
dev_id);
336cfbb0 Vinod Koul 2014-11-11  282 if (ret  0)
336cfbb0 Vinod Koul 2014-11-11  283 return ret;
336cfbb0 Vinod Koul 2014-11-11  284  
336cfbb0 

Re: [kbuild] [ath6kl:ath-next-test 10/13] drivers/net/wireless/ath/ath10k/debug.c:1100 ath10k_mem_value_write() warn: maybe return -EFAULT instead of the bytes remaining?

2014-11-24 Thread Dan Carpenter
On Mon, Nov 24, 2014 at 06:54:52PM +0200, Kalle Valo wrote:
 
 Thanks for the great find!

Thanks.  :)  This Fengguang's automated static checker stuff.  We just
look it over and forward it.

 Is this a right fix:
 
 ret = copy_from_user(buf, user_buf, count);
 if (ret) {
 ret = -EFAULT;
   goto err_free_copy;
 }

Yes.  Although normally people write these like:

if (copy_from_user(buf, user_buf, count)) {
ret = -EFAULT;
goto err_free_copy;
}

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [hch-scsi-queue:drivers-for-3.19 159/180] drivers/scsi/esp_scsi.c:2322 scsi_esp_register() warn: impossible condition '(esp-num_tags = 256) = (0-255 = 256)'

2014-11-26 Thread Dan Carpenter
Of course this is real, but the sanity check is harmless.  Linus was
annoyed by people removing harmless sanity checks like this.

regards,
dan carpenter

On Wed, Nov 26, 2014 at 04:07:35AM +0800, kbuild test robot wrote:
 TO: Hannes Reinecke h...@suse.de
 CC: Christoph Hellwig h...@lst.de
 
 tree:   git://git.infradead.org/users/hch/scsi-queue.git drivers-for-3.19
 head:   38d5c8336e60bf6e53a1da9586befe82fa75171b
 commit: 3707a186c8970e3c4f3c8d9ccf4230b8657e919f [159/180] esp_scsi: make 
 number of tags configurable
 :: branch date: 5 hours ago
 :: commit date: 29 hours ago
 
 drivers/scsi/esp_scsi.c:2322 scsi_esp_register() warn: impossible condition 
 '(esp-num_tags = 256) = (0-255 = 256)'
 
 git remote add hch-scsi-queue git://git.infradead.org/users/hch/scsi-queue.git
 git remote update hch-scsi-queue
 git checkout 3707a186c8970e3c4f3c8d9ccf4230b8657e919f
 vim +2322 drivers/scsi/esp_scsi.c
 
 cd9ad58d David S. Miller 2007-04-26  2306 ESP236,
 cd9ad58d David S. Miller 2007-04-26  2307 FAS236,
 cd9ad58d David S. Miller 2007-04-26  2308 FAS100A,
 cd9ad58d David S. Miller 2007-04-26  2309 FAST,
 cd9ad58d David S. Miller 2007-04-26  2310 FASHME,
 cd9ad58d David S. Miller 2007-04-26  2311  };
 cd9ad58d David S. Miller 2007-04-26  2312  
 cd9ad58d David S. Miller 2007-04-26  2313  static struct 
 scsi_transport_template *esp_transport_template;
 cd9ad58d David S. Miller 2007-04-26  2314  
 76246808 Adrian Bunk 2007-10-11  2315  int scsi_esp_register(struct esp 
 *esp, struct device *dev)
 cd9ad58d David S. Miller 2007-04-26  2316  {
 cd9ad58d David S. Miller 2007-04-26  2317 static int instance;
 cd9ad58d David S. Miller 2007-04-26  2318 int err;
 cd9ad58d David S. Miller 2007-04-26  2319  
 3707a186 Hannes Reinecke 2014-11-24  2320 if (!esp-num_tags)
 3707a186 Hannes Reinecke 2014-11-24  2321 esp-num_tags = 
 ESP_DEFAULT_TAGS;
 3707a186 Hannes Reinecke 2014-11-24 @2322 else if (esp-num_tags = 
 ESP_MAX_TAG)
 3707a186 Hannes Reinecke 2014-11-24  2323 esp-num_tags = 
 ESP_MAX_TAG - 1;
 cd9ad58d David S. Miller 2007-04-26  2324 esp-host-transportt = 
 esp_transport_template;
 cd9ad58d David S. Miller 2007-04-26  2325 esp-host-max_lun = 
 ESP_MAX_LUN;
 cd9ad58d David S. Miller 2007-04-26  2326 esp-host-cmd_per_lun = 2;
 ff4abd6c David Miller2007-08-24  2327 esp-host-unique_id = instance;
 cd9ad58d David S. Miller 2007-04-26  2328  
 cd9ad58d David S. Miller 2007-04-26  2329 esp_set_clock_params(esp);
 cd9ad58d David S. Miller 2007-04-26  2330  
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [hch-scsi-queue:drivers-for-3.19 180/180] drivers/scsi/scsi_debug.c:3063 resp_comp_write() warn: possible memory leak of 'arr'

2014-11-26 Thread Dan Carpenter
[ Move the allocation after the sanity checks?  - dan ]

tree:   git://git.infradead.org/users/hch/scsi-queue.git drivers-for-3.19
head:   38d5c8336e60bf6e53a1da9586befe82fa75171b
commit: 38d5c8336e60bf6e53a1da9586befe82fa75171b [180/180] scsi_debug: add 
Report supported opcodes+tmfs; Compare and write

drivers/scsi/scsi_debug.c:3063 resp_comp_write() warn: possible memory leak of 
'arr'
drivers/scsi/scsi_debug.c:3074 resp_comp_write() warn: possible memory leak of 
'arr'
drivers/scsi/scsi_debug.c:3080 resp_comp_write() warn: possible memory leak of 
'arr'

git remote add hch-scsi-queue git://git.infradead.org/users/hch/scsi-queue.git
git remote update hch-scsi-queue
git checkout 38d5c8336e60bf6e53a1da9586befe82fa75171b
vim +/arr +3063 drivers/scsi/scsi_debug.c

38d5c833 Douglas Gilbert 2014-11-24  3057   
INSUFF_RES_ASCQ);
38d5c833 Douglas Gilbert 2014-11-24  3058   return 
check_condition_result;
38d5c833 Douglas Gilbert 2014-11-24  3059   }
38d5c833 Douglas Gilbert 2014-11-24  3060   if (scsi_debug_dif == 
SD_DIF_TYPE2_PROTECTION 
38d5c833 Douglas Gilbert 2014-11-24  3061   (cmd[1]  0xe0)) {
38d5c833 Douglas Gilbert 2014-11-24  3062   
mk_sense_invalid_opcode(scp);
38d5c833 Douglas Gilbert 2014-11-24 @3063   return 
check_condition_result;
38d5c833 Douglas Gilbert 2014-11-24  3064   }
38d5c833 Douglas Gilbert 2014-11-24  3065   if ((scsi_debug_dif == 
SD_DIF_TYPE1_PROTECTION ||
38d5c833 Douglas Gilbert 2014-11-24  3066scsi_debug_dif == 
SD_DIF_TYPE3_PROTECTION) 
38d5c833 Douglas Gilbert 2014-11-24  3067   (cmd[1]  0xe0) == 0)
38d5c833 Douglas Gilbert 2014-11-24  3068   sdev_printk(KERN_ERR, 
scp-device, Unprotected WR 
38d5c833 Douglas Gilbert 2014-11-24  3069   to DIF 
device\n);
38d5c833 Douglas Gilbert 2014-11-24  3070  
38d5c833 Douglas Gilbert 2014-11-24  3071   /* inline 
check_device_access_params() */
38d5c833 Douglas Gilbert 2014-11-24  3072   if (lba + num  
sdebug_capacity) {
38d5c833 Douglas Gilbert 2014-11-24  3073   mk_sense_buffer(scp, 
ILLEGAL_REQUEST, LBA_OUT_OF_RANGE, 0);
38d5c833 Douglas Gilbert 2014-11-24 @3074   return 
check_condition_result;
38d5c833 Douglas Gilbert 2014-11-24  3075   }
38d5c833 Douglas Gilbert 2014-11-24  3076   /* transfer length excessive 
(tie in to block limits VPD page) */
38d5c833 Douglas Gilbert 2014-11-24  3077   if (num  sdebug_store_sectors) 
{
38d5c833 Douglas Gilbert 2014-11-24  3078   /* needs work to find 
which cdb byte 'num' comes from */
38d5c833 Douglas Gilbert 2014-11-24  3079   mk_sense_buffer(scp, 
ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB, 0);
38d5c833 Douglas Gilbert 2014-11-24 @3080   return 
check_condition_result;
38d5c833 Douglas Gilbert 2014-11-24  3081   }
38d5c833 Douglas Gilbert 2014-11-24  3082  
38d5c833 Douglas Gilbert 2014-11-24  3083   write_lock_irqsave(atomic_rw, 
iflags);

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [ext4:dev 15/21] fs/ext4/extents_status.c:1049 __es_shrink() warn: inconsistent returns 'write_lock:ei-i_es_lock'.

2014-11-26 Thread Dan Carpenter
False positive in Smatch.  I was missing the _raw_write_unlock()
function, I've added it and will push soon.

regards,
dan carpenter

On Wed, Nov 26, 2014 at 05:13:26AM +0800, kbuild test robot wrote:
 TO: Zheng Liu wenqing...@taobao.com
 CC: Theodore Ts'o ty...@mit.edu
 CC: Jan Kara j...@suse.cz
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
 head:   c2d00875c151087c41e23a5afd6bd807019c9a53
 commit: aaf3ce623d42e534492c19e3b314c800e8d97b84 [15/21] ext4: change LRU to 
 round-robin in extent status tree shrinker
 :: branch date: 3 hours ago
 :: commit date: 4 hours ago
 
 fs/ext4/extents_status.c:1049 __es_shrink() warn: inconsistent returns 
 'write_lock:ei-i_es_lock'.
   Locked on:   line 1049
   Unlocked on: line 1049
 
 git remote add ext4 
 git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
 git remote update ext4
 git checkout aaf3ce623d42e534492c19e3b314c800e8d97b84
 vim +1049 fs/ext4/extents_status.c
 
 eb68d0e2 Zheng Liu 2014-09-01  1033   scan_time = 
 ktime_to_ns(ktime_sub(ktime_get(), start_time));
 eb68d0e2 Zheng Liu 2014-09-01  1034   if 
 (likely(es_stats-es_stats_scan_time))
 eb68d0e2 Zheng Liu 2014-09-01  1035   
 es_stats-es_stats_scan_time = (scan_time +
 eb68d0e2 Zheng Liu 2014-09-01  1036   
 es_stats-es_stats_scan_time*3) / 4;
 eb68d0e2 Zheng Liu 2014-09-01  1037   else
 eb68d0e2 Zheng Liu 2014-09-01  1038   
 es_stats-es_stats_scan_time = scan_time;
 eb68d0e2 Zheng Liu 2014-09-01  1039   if (scan_time  
 es_stats-es_stats_max_scan_time)
 eb68d0e2 Zheng Liu 2014-09-01  1040   
 es_stats-es_stats_max_scan_time = scan_time;
 eb68d0e2 Zheng Liu 2014-09-01  1041   if 
 (likely(es_stats-es_stats_shrunk))
 eb68d0e2 Zheng Liu 2014-09-01  1042   
 es_stats-es_stats_shrunk = (nr_shrunk +
 eb68d0e2 Zheng Liu 2014-09-01  1043   
 es_stats-es_stats_shrunk*3) / 4;
 eb68d0e2 Zheng Liu 2014-09-01  1044   else
 eb68d0e2 Zheng Liu 2014-09-01  1045   
 es_stats-es_stats_shrunk = nr_shrunk;
 eb68d0e2 Zheng Liu 2014-09-01  1046  
 aaf3ce62 Zheng Liu 2014-11-25  1047   trace_ext4_es_shrink(sbi-s_sb, 
 nr_shrunk, scan_time,
 eb68d0e2 Zheng Liu 2014-09-01  1048
 nr_skipped, retried);
 e15f742c Theodore Ts'o 2013-07-15 @1049   return nr_shrunk;
 e15f742c Theodore Ts'o 2013-07-15  1050  }
 e15f742c Theodore Ts'o 2013-07-15  1051  
 1ab6c499 Dave Chinner  2013-08-28  1052  static unsigned long 
 ext4_es_count(struct shrinker *shrink,
 1ab6c499 Dave Chinner  2013-08-28  1053  
 struct shrink_control *sc)
 1ab6c499 Dave Chinner  2013-08-28  1054  {
 1ab6c499 Dave Chinner  2013-08-28  1055   unsigned long nr;
 1ab6c499 Dave Chinner  2013-08-28  1056   struct ext4_sb_info *sbi;
 1ab6c499 Dave Chinner  2013-08-28  1057  
 
 :: The code at line 1049 was first introduced by commit
 :: e15f742ce816076497549b955fbec3254820db85 ext4: make the extent_status 
 code more robust against ENOMEM failures
 
 :: TO: Theodore Ts'o ty...@mit.edu
 :: CC: Theodore Ts'o ty...@mit.edu
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 6668/9040] drivers/usb/gadget/udc/bdc/bdc_ep.c:193 ep_bd_list_alloc() warn: possible memory leak of 'bd_table'

2014-11-26 Thread Dan Carpenter
I reported these already.

regards,
dan carpenter

On Wed, Nov 26, 2014 at 06:04:01AM +0800, kbuild test robot wrote:
 TO: Ashwini Pahuja ashwini.li...@gmail.com
 CC: Felipe Balbi ba...@ti.com
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
 master
 head:   7cc2ecdb63cfae062aeadc7c575a02b6e9cc4dbb
 commit: efed421a94e62a7ddbc76acba4312b70e4be958f [6668/9040] usb: gadget: Add 
 UDC driver for Broadcom USB3.0 device controller IP BDC
 :: branch date: 10 hours ago
 :: commit date: 7 days ago
 
 drivers/usb/gadget/udc/bdc/bdc_ep.c:193 ep_bd_list_alloc() warn: possible 
 memory leak of 'bd_table'
 drivers/usb/gadget/udc/bdc/bdc_ep.c:721 ep_queue() warn: variable 
 dereferenced before check 'ep' (see line 720)
 
 git remote add next 
 git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
 git remote update next
 git checkout efed421a94e62a7ddbc76acba4312b70e4be958f
 vim +/bd_table +193 drivers/usb/gadget/udc/bdc/bdc_ep.c
 
 efed421a Ashwini Pahuja 2014-11-13  177   prev_table = bd_table;
 efed421a Ashwini Pahuja 2014-11-13  178   }
 efed421a Ashwini Pahuja 2014-11-13  179   chain_table(prev_table, 
 ep-bd_list.bd_table_array[0], bd_p_tab);
 efed421a Ashwini Pahuja 2014-11-13  180   /* Memory allocation is 
 successful, now init the internal fields */
 efed421a Ashwini Pahuja 2014-11-13  181   ep-bd_list.num_tabs = num_tabs;
 efed421a Ashwini Pahuja 2014-11-13  182   ep-bd_list.max_bdi  = 
 (num_tabs * bd_p_tab) - 1;
 efed421a Ashwini Pahuja 2014-11-13  183   ep-bd_list.num_tabs = num_tabs;
 efed421a Ashwini Pahuja 2014-11-13  184   ep-bd_list.num_bds_table = 
 bd_p_tab;
 efed421a Ashwini Pahuja 2014-11-13  185   ep-bd_list.eqp_bdi = 0;
 efed421a Ashwini Pahuja 2014-11-13  186   ep-bd_list.hwd_bdi = 0;
 efed421a Ashwini Pahuja 2014-11-13  187  
 efed421a Ashwini Pahuja 2014-11-13  188   return 0;
 efed421a Ashwini Pahuja 2014-11-13  189  fail:
 efed421a Ashwini Pahuja 2014-11-13  190   /* Free the bd_table_array, 
 bd_table struct, bd's */
 efed421a Ashwini Pahuja 2014-11-13  191   ep_bd_list_free(ep, num_tabs);
 efed421a Ashwini Pahuja 2014-11-13  192  
 efed421a Ashwini Pahuja 2014-11-13 @193   return -ENOMEM;
 efed421a Ashwini Pahuja 2014-11-13  194  }
 efed421a Ashwini Pahuja 2014-11-13  195  
 efed421a Ashwini Pahuja 2014-11-13  196  /* returns how many bd's are need 
 for this transfer */
 efed421a Ashwini Pahuja 2014-11-13  197  static inline int 
 bd_needed_req(struct bdc_req *req)
 efed421a Ashwini Pahuja 2014-11-13  198  {
 efed421a Ashwini Pahuja 2014-11-13  199   int bd_needed = 0;
 efed421a Ashwini Pahuja 2014-11-13  200   int remaining;
 efed421a Ashwini Pahuja 2014-11-13  201  
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [rw:fastmap_upgrade2 24/41] drivers/mtd/ubi/fastmap.c:1413 ubi_update_fastmap() error: buffer overflow 'old_fm-e' 32 = 32

2014-11-26 Thread Dan Carpenter
False positive.

regards,
dan carpenter

On Wed, Nov 26, 2014 at 07:32:52AM +0800, kbuild test robot wrote:
 TO: Richard Weinberger rich...@nod.at
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git 
 fastmap_upgrade2
 head:   1335c6aa4073429ab1f7f48976b47032b78ba337
 commit: 3df0681c9097006bbfb54750d4bb54f1d487fb6b [24/41] UBI: Fastmap: 
 Prepare for variable sized fastmaps
 :: branch date: 29 hours ago
 :: commit date: 30 hours ago
 
 drivers/mtd/ubi/fastmap.c:1413 ubi_update_fastmap() error: buffer overflow 
 'old_fm-e' 32 = 32
 
 git remote add rw git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc.git
 git remote update rw
 git checkout 3df0681c9097006bbfb54750d4bb54f1d487fb6b
 vim +1413 drivers/mtd/ubi/fastmap.c
 
 326087033 Tanya Brokhman 2014-10-20  1397 
 ubi_err(ubi, could not erase old fastmap PEB);
 dbb7d2a88 Richard Weinberger 2012-09-26  1398 
 goto err;
 dbb7d2a88 Richard Weinberger 2012-09-26  1399 }
 bdd5894ba Richard Weinberger 2014-10-06  1400 
 new_fm-e[i] = old_fm-e[i];
 dbb7d2a88 Richard Weinberger 2012-09-26  1401 } else {
 bdd5894ba Richard Weinberger 2014-10-06  1402 
 new_fm-e[i] = tmp_e;
 dbb7d2a88 Richard Weinberger 2012-09-26  1403  
 3df0681c9 Richard Weinberger 2014-10-29  1404 if 
 (old_fm  old_fm-e[i])
 3df0681c9 Richard Weinberger 2014-10-29  1405 
 ubi_wl_put_fm_peb(ubi, old_fm-e[i], i,
 3df0681c9 Richard Weinberger 2014-10-29  1406 
   old_fm-to_be_tortured[i]);
 3df0681c9 Richard Weinberger 2014-10-29  1407 }
 3df0681c9 Richard Weinberger 2014-10-29  1408 }
 3df0681c9 Richard Weinberger 2014-10-29  1409  
 3df0681c9 Richard Weinberger 2014-10-29  1410 /* Old fastmap is 
 larger than the new one */
 3df0681c9 Richard Weinberger 2014-10-29  1411 if (old_fm  
 new_fm-used_blocks  old_fm-used_blocks) {
 3df0681c9 Richard Weinberger 2014-10-29  1412 for (i = 
 new_fm-used_blocks; i  old_fm-used_blocks; i++) {
 dbb7d2a88 Richard Weinberger 2012-09-26 @1413 
 ubi_wl_put_fm_peb(ubi, old_fm-e[i], i,
 dbb7d2a88 Richard Weinberger 2012-09-26  1414 
   old_fm-to_be_tortured[i]);
 dbb7d2a88 Richard Weinberger 2012-09-26  1415 }
 dbb7d2a88 Richard Weinberger 2012-09-26  1416 }
 dbb7d2a88 Richard Weinberger 2012-09-26  1417  
 dbb7d2a88 Richard Weinberger 2012-09-26  1418 
 spin_lock(ubi-wl_lock);
 dbb7d2a88 Richard Weinberger 2012-09-26  1419 tmp_e = 
 ubi_wl_get_fm_peb(ubi, 1);
 dbb7d2a88 Richard Weinberger 2012-09-26  1420 
 spin_unlock(ubi-wl_lock);
 dbb7d2a88 Richard Weinberger 2012-09-26  1421  
 
 :: The code at line 1413 was first introduced by commit
 :: dbb7d2a88d2a7bd3624e090bee42cdee048d9290 UBI: Add fastmap core
 
 :: TO: Richard Weinberger rich...@nod.at
 :: CC: Artem Bityutskiy artem.bityuts...@linux.intel.com
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net:master 18/18] drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:275 stmmac_pltfr_probe() warn: variable dereferenced before check 'plat_dat' (see line 269)

2014-11-26 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head:   571dcfde23712b92e45a126f415d9424af0c2886
commit: 571dcfde23712b92e45a126f415d9424af0c2886 [18/18] stmmac: platform: fix 
default values of the filter bins setting

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:275 stmmac_pltfr_probe() 
warn: variable dereferenced before check 'plat_dat' (see line 269)

git remote add net git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
git remote update net
git checkout 571dcfde23712b92e45a126f415d9424af0c2886
vim +/plat_dat +275 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

5760f427c Silviu-Mihai Popescu 2013-04-11  263  if (IS_ERR(addr))
5760f427c Silviu-Mihai Popescu 2013-04-11  264  return 
PTR_ERR(addr);
6a228452d Stefan Roese 2012-03-13  265  
f91b29f5b Jingoo Han   2013-08-30  266  plat_dat = 
dev_get_platdata(pdev-dev);
571dcfde2 Huacai Chen  2014-11-26  267  
571dcfde2 Huacai Chen  2014-11-26  268  /* Set default value 
for multicast hash bins */
571dcfde2 Huacai Chen  2014-11-26 @269  
plat_dat-multicast_filter_bins = HASH_TABLE_SIZE;
571dcfde2 Huacai Chen  2014-11-26  270  
571dcfde2 Huacai Chen  2014-11-26  271  /* Set default value 
for unicast filter entries */
571dcfde2 Huacai Chen  2014-11-26  272  
plat_dat-unicast_filter_entries = 1;
571dcfde2 Huacai Chen  2014-11-26  273  
6a228452d Stefan Roese 2012-03-13  274  if (pdev-dev.of_node) {
d741434c3 Srinivas Kandagatla  2013-07-04 @275  if (!plat_dat)
6a228452d Stefan Roese 2012-03-13  276  
plat_dat = devm_kzalloc(pdev-dev,
6a228452d Stefan Roese 2012-03-13  277  
sizeof(struct plat_stmmacenet_data),
6a228452d Stefan Roese 2012-03-13  278  
GFP_KERNEL);

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [staging:staging-next 1159/1285] drivers/staging/vt6655/rf.c:930 RFbSetPower() error: buffer overflow 'priv-abyCCKPwrTbl' 15 = 56

2014-12-01 Thread Dan Carpenter
[ The renaming made the kbuild scripts think this is a new bug when it's
  old.  Oh well.  It still might be worth fixing.  -dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-next
head:   aa9d9be96d33d97488e1bdf13a144931a3fce08e
commit: ac3e134af262a74c4c9b0857cd6b4e1cbcddc783 [1159/1285] staging: vt6655: 
rf.c camel calse vnt_private rename pDevice to priv

drivers/staging/vt6655/rf.c:930 RFbSetPower() error: buffer overflow 
'priv-abyCCKPwrTbl' 15 = 56

git remote add staging 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git remote update staging
git checkout ac3e134af262a74c4c9b0857cd6b4e1cbcddc783
vim +930 drivers/staging/vt6655/rf.c

7b6a0013 Charles Clément   2010-08-01  914  bool bResult = true;
3fc9b584 Charles Clément   2010-06-24  915  unsigned char byPwr = 0;
3fc9b584 Charles Clément   2010-06-24  916  unsigned char byDec = 0;
3fc9b584 Charles Clément   2010-06-24  917  unsigned char byPwrdBm = 0;
5449c685 Forest Bond   2009-04-25  918  
ac3e134a Malcolm Priestley 2014-11-12  919  if (priv-dwDiagRefCount != 0)
1b12068a Charles Clément   2010-08-01  920  return true;
bc5cf656 Guido Martínez2014-04-19  921  
bc5cf656 Guido Martínez2014-04-19  922  if ((uCH  1) || (uCH  
CB_MAX_CHANNEL))
5a5a2a6a Charles Clément   2010-08-01  923  return false;
5449c685 Forest Bond   2009-04-25  924  
5449c685 Forest Bond   2009-04-25  925  switch (uRATE) {
5449c685 Forest Bond   2009-04-25  926  case RATE_1M:
5449c685 Forest Bond   2009-04-25  927  case RATE_2M:
5449c685 Forest Bond   2009-04-25  928  case RATE_5M:
5449c685 Forest Bond   2009-04-25  929  case RATE_11M:
ac3e134a Malcolm Priestley 2014-11-12 @930  byPwr = 
priv-abyCCKPwrTbl[uCH];
ac3e134a Malcolm Priestley 2014-11-12  931  byPwrdBm = 
priv-abyCCKDefaultPwr[uCH];
5449c685 Forest Bond   2009-04-25  932  break;
5449c685 Forest Bond   2009-04-25  933  case RATE_6M:
5449c685 Forest Bond   2009-04-25  934  case RATE_9M:
5449c685 Forest Bond   2009-04-25  935  case RATE_18M:
ac3e134a Malcolm Priestley 2014-11-12  936  byPwr = 
priv-abyOFDMPwrTbl[uCH];
ac3e134a Malcolm Priestley 2014-11-12  937  if (priv-byRFType == 
RF_UW2452)
5449c685 Forest Bond   2009-04-25  938  byDec = byPwr + 
14;

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [vhost:vhost-next 47/52] drivers/char/virtio_console.c:1644 handle_control_message() error: we previously assumed 'port' could be null (see line 1617)

2014-12-02 Thread Dan Carpenter
False positive.

regards,
dan carpenter

On Tue, Dec 02, 2014 at 12:21:29AM +0800, kbuild test robot wrote:
 TO: Michael S. Tsirkin m...@redhat.com
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-next
 head:   c9a21e033bc57d6c34474730680bf2d6a3d036fe
 commit: 4c58c104682abcd422ac734a3575b8ed0a200157 [47/52] virtio_console: 
 virtio 1.0 support
 :: branch date: 19 minutes ago
 :: commit date: 20 minutes ago
 
 drivers/char/virtio_console.c:1644 handle_control_message() error: we 
 previously assumed 'port' could be null (see line 1617)
 
 git remote add vhost 
 git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git
 git remote update vhost
 git checkout 4c58c104682abcd422ac734a3575b8ed0a200157
 vim +/port +1644 drivers/char/virtio_console.c
 
 431edb8a Amit Shah  2009-12-21  1611  size_t name_size;
 431edb8a Amit Shah  2009-12-21  1612  int err;
 17634ba2 Amit Shah  2009-12-21  1613  
 17634ba2 Amit Shah  2009-12-21  1614  cpkt = (struct 
 virtio_console_control *)(buf-buf + buf-offset);
 17634ba2 Amit Shah  2009-12-21  1615  
 4c58c104 Michael S. Tsirkin 2014-12-01  1616  port = 
 find_port_by_id(portdev, virtio32_to_cpu(vdev, cpkt-id));
 4c58c104 Michael S. Tsirkin 2014-12-01 @1617  if (!port 
 4c58c104 Michael S. Tsirkin 2014-12-01  1618  cpkt-event != 
 cpu_to_virtio16(vdev, VIRTIO_CONSOLE_PORT_ADD)) {
 17634ba2 Amit Shah  2009-12-21  1619  /* No valid 
 header at start of buffer.  Drop it. */
 17634ba2 Amit Shah  2009-12-21  1620  
 dev_dbg(portdev-vdev-dev,
 17634ba2 Amit Shah  2009-12-21  1621  
 Invalid index %u in control packet\n, cpkt-id);
 17634ba2 Amit Shah  2009-12-21  1622  return;
 17634ba2 Amit Shah  2009-12-21  1623  }
 17634ba2 Amit Shah  2009-12-21  1624  
 4c58c104 Michael S. Tsirkin 2014-12-01  1625  switch 
 (virtio16_to_cpu(vdev, cpkt-event)) {
 f909f850 Amit Shah  2010-05-19  1626  case 
 VIRTIO_CONSOLE_PORT_ADD:
 f909f850 Amit Shah  2010-05-19  1627  if (port) {
 1d05160b Amit Shah  2010-05-19  1628  
 dev_dbg(portdev-vdev-dev,
 1d05160b Amit Shah  2010-05-19  1629  
 Port %u already added\n, port-id);
 f909f850 Amit Shah  2010-05-19  1630  
 send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1);
 f909f850 Amit Shah  2010-05-19  1631  break;
 f909f850 Amit Shah  2010-05-19  1632  }
 4c58c104 Michael S. Tsirkin 2014-12-01  1633  if 
 (virtio32_to_cpu(vdev, cpkt-id) =
 4c58c104 Michael S. Tsirkin 2014-12-01  1634  
 portdev-config.max_nr_ports) {
 f909f850 Amit Shah  2010-05-19  1635  
 dev_warn(portdev-vdev-dev,
 4c58c104 Michael S. Tsirkin 2014-12-01  1636  
 Request for adding port with 
 4c58c104 Michael S. Tsirkin 2014-12-01  1637  
 out-of-bound id %u, max. supported id: %u\n,
 f909f850 Amit Shah  2010-05-19  1638  
 cpkt-id, portdev-config.max_nr_ports - 1);
 f909f850 Amit Shah  2010-05-19  1639  break;
 f909f850 Amit Shah  2010-05-19  1640  }
 4c58c104 Michael S. Tsirkin 2014-12-01  1641  
 add_port(portdev, virtio32_to_cpu(vdev, cpkt-id));
 f909f850 Amit Shah  2010-05-19  1642  break;
 f909f850 Amit Shah  2010-05-19  1643  case 
 VIRTIO_CONSOLE_PORT_REMOVE:
 b353a6b8 Amit Shah  2010-09-02 @1644  
 unplug_port(port);
 f909f850 Amit Shah  2010-05-19  1645  break;
 17634ba2 Amit Shah  2009-12-21  1646  case 
 VIRTIO_CONSOLE_CONSOLE_PORT:
 17634ba2 Amit Shah  2009-12-21  1647  if 
 (!cpkt-value)
 
 :: The code at line 1644 was first introduced by commit
 :: b353a6b821627053f82b4e7b907e824cb7a6879c virtio: console: Add 
 reference counting for port struct
 
 :: TO: Amit Shah amit.s...@redhat.com
 :: CC: Rusty Russell ru...@rustcorp.com.au
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [nfc-next:master 18/38] net/nfc/nci/ntf.c:487 nci_store_general_bytes_nfc_dep() error: __builtin_memcpy() '(ntf-activation_params.poll_nfc_dep.atr_res[15])' too small (47 vs 48)

2014-12-02 Thread Dan Carpenter
This code is hard to read because we have datatypes like:

struct rf_tech_specific_params_nfca_poll nfca_poll;
struct rf_tech_specific_params_nfcb_poll nfcb_poll;
struct rf_tech_specific_params_nfcf_poll nfcf_poll;
struct rf_tech_specific_params_nfcv_poll nfcv_poll;

The variable names are a million characters long and you have to spot
the one character which is different.  Do we really need to put the
whole works of Shakespere into that struct name?

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git master
head:   a2ae21829833611fe3d73b09cfada5823c37aef0
commit: a99903ec4566eeeaaaf611499cae00abbe844938 [18/38] NFC: NCI: Handle 
Target mode activation

net/nfc/nci/ntf.c:487 nci_store_general_bytes_nfc_dep() error: 
__builtin_memcpy() '(ntf-activation_params.poll_nfc_dep.atr_res[15])' too 
small (47 vs 48)

git remote add nfc-next 
git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git
git remote update nfc-next
git checkout a99903ec4566eeeaaaf611499cae00abbe844938
vim +487 net/nfc/nci/ntf.c

a99903ec Julien Lefrique 2014-10-21  471  static int 
nci_store_general_bytes_nfc_dep(struct nci_dev *ndev,
a99903ec Julien Lefrique 2014-10-21  472struct 
nci_rf_intf_activated_ntf *ntf)
a99903ec Julien Lefrique 2014-10-21  473  {
a99903ec Julien Lefrique 2014-10-21  474ndev-remote_gb_len = 0;
a99903ec Julien Lefrique 2014-10-21  475  
a99903ec Julien Lefrique 2014-10-21  476if (ntf-activation_params_len 
= 0)
a99903ec Julien Lefrique 2014-10-21  477return NCI_STATUS_OK;
a99903ec Julien Lefrique 2014-10-21  478  
a99903ec Julien Lefrique 2014-10-21  479switch 
(ntf-activation_rf_tech_and_mode) {
a99903ec Julien Lefrique 2014-10-21  480case 
NCI_NFC_A_PASSIVE_POLL_MODE:
a99903ec Julien Lefrique 2014-10-21  481case 
NCI_NFC_F_PASSIVE_POLL_MODE:
a99903ec Julien Lefrique 2014-10-21  482/* ATR_RES general 
bytes at offset 15 */

This comment is not needed because NFC_ATR_RES_GT_OFFSET means 15.

a99903ec Julien Lefrique 2014-10-21  483ndev-remote_gb_len = 
min_t(__u8,

The __u8 datatype is for use in code which is shared with userspace.  I
think we could just use u8 here.

a99903ec Julien Lefrique 2014-10-21  484
(ntf-activation_params.poll_nfc_dep.atr_res_len
a99903ec Julien Lefrique 2014-10-21  485
- NFC_ATR_RES_GT_OFFSET),
a99903ec Julien Lefrique 2014-10-21  486NFC_MAX_GT_LEN);
a99903ec Julien Lefrique 2014-10-21 @487memcpy(ndev-remote_gb,
a99903ec Julien Lefrique 2014-10-21  488   
(ntf-activation_params.poll_nfc_dep .atr_res

There is an extra space before in poll_nfc_dep .atr_res.

The indenting here is all weird because we have a bunch of really long
variable names and we're trying to squeeze into the 80 character limit.
I tried adding a local nfc_dep pointer instead of
ntf-activation_params.poll_nfc_dep but that wasn't enough to fix it
completely.  Here is the bast I was able to come up with:

case NCI_NFC_F_PASSIVE_POLL_MODE: {
struct activation_params_poll_nfc_dep *nfc_dep;

nfc_dep = ntf-activation_params.poll_nfc_dep;

ndev-remote_gb_len = min_t(u8,
nfc_dep-atr_res_len - NFC_ATR_RES_GT_OFFSET,
NFC_MAX_GT_LEN);
memcpy(ndev-remote_gb,
   nfc_dep-atr_res + NFC_ATR_RES_GT_OFFSET,
   ndev-remote_gb_len);
break;
}

But it still has the off-by-one bug, of course.

regards,
dan carpenter

a99903ec Julien Lefrique 2014-10-21  489
+ NFC_ATR_RES_GT_OFFSET),
a99903ec Julien Lefrique 2014-10-21  490   
ndev-remote_gb_len);
a99903ec Julien Lefrique 2014-10-21  491break;
a99903ec Julien Lefrique 2014-10-21  492  
a99903ec Julien Lefrique 2014-10-21  493case 
NCI_NFC_A_PASSIVE_LISTEN_MODE:
a99903ec Julien Lefrique 2014-10-21  494case 
NCI_NFC_F_PASSIVE_LISTEN_MODE:
a99903ec Julien Lefrique 2014-10-21  495/* ATR_REQ general 
bytes at offset 14 */

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [target:for-next 42/63] drivers/infiniband/ulp/isert/ib_isert.c:862 isert_np_cma_handler() warn: missing break? reassigning 'isert_np-np_cm_id'

2014-12-02 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git 
for-next
head:   5ad7c8c97972ab9046d83048db4c3d71a1cb2bcb
commit: bcf5944542d89af893fadd8a5fa160c8b713c174 [42/63] iser-target: Handle 
ADDR_CHANGE event for listener cm_id

New smatch warnings:
drivers/infiniband/ulp/isert/ib_isert.c:862 isert_np_cma_handler() warn: 
missing break? reassigning 'isert_np-np_cm_id'

Old smatch warnings:
drivers/infiniband/ulp/isert/ib_isert.c:724 isert_connect_request() warn: 
inconsistent returns 'sem:isert_np-np_sem'.
  Locked on:   line 583
  Unlocked on: line 704

[ The reason for these warnings with that we probably return success if
  we hit the Protection information requested but not supported,
  rejecting connect request exit state.  -dan ]

drivers/infiniband/ulp/isert/ib_isert.c:3306 isert_accept_np() warn: 
inconsistent returns 'sem:isert_np-np_sem'.
  Locked on:   line 3283
  Unlocked on: line 3272

git remote add target 
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git
git remote update target
git checkout bcf5944542d89af893fadd8a5fa160c8b713c174
vim +862 drivers/infiniband/ulp/isert/ib_isert.c

b2cb9649 Nicholas Bellinger 2013-07-03  846  }
9d49f5e2 Sagi Grimberg  2014-05-19  847  
3b726ae2 Sagi Grimberg  2014-10-28  848  static int
bcf59445 Sagi Grimberg  2014-12-01  849  isert_np_cma_handler(struct 
isert_np *isert_np,
bcf59445 Sagi Grimberg  2014-12-01  850  enum 
rdma_cm_event_type event)
b8d26b3b Nicholas Bellinger 2013-03-07  851  {
bcf59445 Sagi Grimberg  2014-12-01  852 pr_debug(isert np %p, handling 
event %d\n, isert_np, event);
3b726ae2 Sagi Grimberg  2014-10-28  853  
bcf59445 Sagi Grimberg  2014-12-01  854 switch (event) {
bcf59445 Sagi Grimberg  2014-12-01  855 case RDMA_CM_EVENT_ADDR_CHANGE:
bcf59445 Sagi Grimberg  2014-12-01  856 isert_np-np_cm_id = 
isert_setup_id(isert_np);
bcf59445 Sagi Grimberg  2014-12-01  857 if 
(!IS_ERR(isert_np-np_cm_id))
bcf59445 Sagi Grimberg  2014-12-01  858 break;
bcf59445 Sagi Grimberg  2014-12-01  859 pr_err(isert np %p 
setup id failed: %ld\n, isert_np,
bcf59445 Sagi Grimberg  2014-12-01  860   
PTR_ERR(isert_np-np_cm_id));
bcf59445 Sagi Grimberg  2014-12-01  861 case 
RDMA_CM_EVENT_DEVICE_REMOVAL:
3b726ae2 Sagi Grimberg  2014-10-28 @862 isert_np-np_cm_id = 
NULL;
bcf59445 Sagi Grimberg  2014-12-01  863 break;
bcf59445 Sagi Grimberg  2014-12-01  864 default:
bcf59445 Sagi Grimberg  2014-12-01  865 pr_err(isert np %p 
Unexpected event %d\n,
bcf59445 Sagi Grimberg  2014-12-01  866   isert_np, 
event);
bcf59445 Sagi Grimberg  2014-12-01  867 }
bcf59445 Sagi Grimberg  2014-12-01  868  
3b726ae2 Sagi Grimberg  2014-10-28  869 return -1;
3b726ae2 Sagi Grimberg  2014-10-28  870  }

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 1269/1276] drivers/net/ethernet/rocker/rocker.c:1021 rocker_port_set_enable() warn: should '1 rocker_port-lport' be a 64 bit type?

2014-12-02 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   cbc24658baac5ca96d20d4a6ca9a8c41581a6e63
commit: 4b8ac9660af07be6f6602b523929793eed314997 [1269/1276] rocker: introduce 
rocker switch driver

drivers/net/ethernet/rocker/rocker.c:1021 rocker_port_set_enable() warn: should 
'1  rocker_port-lport' be a 64 bit type?

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout 4b8ac9660af07be6f6602b523929793eed314997
vim +1021 drivers/net/ethernet/rocker/rocker.c

4b8ac966 Jiri Pirko 2014-11-28  1005struct rocker *rocker = 
rocker_port-rocker;
4b8ac966 Jiri Pirko 2014-11-28  1006  
4b8ac966 Jiri Pirko 2014-11-28  1007rocker_dma_rx_ring_skbs_free(rocker, 
rocker_port);
4b8ac966 Jiri Pirko 2014-11-28  1008rocker_dma_ring_bufs_free(rocker, 
rocker_port-rx_ring,
4b8ac966 Jiri Pirko 2014-11-28  1009  
PCI_DMA_BIDIRECTIONAL);
4b8ac966 Jiri Pirko 2014-11-28  1010rocker_dma_ring_destroy(rocker, 
rocker_port-rx_ring);
4b8ac966 Jiri Pirko 2014-11-28  1011rocker_dma_ring_bufs_free(rocker, 
rocker_port-tx_ring,
4b8ac966 Jiri Pirko 2014-11-28  1012  
PCI_DMA_TODEVICE);
4b8ac966 Jiri Pirko 2014-11-28  1013rocker_dma_ring_destroy(rocker, 
rocker_port-tx_ring);
4b8ac966 Jiri Pirko 2014-11-28  1014  }
4b8ac966 Jiri Pirko 2014-11-28  1015  
4b8ac966 Jiri Pirko 2014-11-28  1016  static void rocker_port_set_enable(struct 
rocker_port *rocker_port, bool enable)
4b8ac966 Jiri Pirko 2014-11-28  1017  {
4b8ac966 Jiri Pirko 2014-11-28  1018u64 val = 
rocker_read64(rocker_port-rocker, PORT_PHYS_ENABLE);
4b8ac966 Jiri Pirko 2014-11-28  1019  
4b8ac966 Jiri Pirko 2014-11-28  1020if (enable)
4b8ac966 Jiri Pirko 2014-11-28 @1021val |= 1  rocker_port-lport;
4b8ac966 Jiri Pirko 2014-11-28  1022else
4b8ac966 Jiri Pirko 2014-11-28  1023val = ~(1  
rocker_port-lport);
4b8ac966 Jiri Pirko 2014-11-28  1024rocker_write64(rocker_port-rocker, 
PORT_PHYS_ENABLE, val);
4b8ac966 Jiri Pirko 2014-11-28  1025  }
4b8ac966 Jiri Pirko 2014-11-28  1026  
4b8ac966 Jiri Pirko 2014-11-28  1027  /
4b8ac966 Jiri Pirko 2014-11-28  1028   * Interrupt handler and helpers
4b8ac966 Jiri Pirko 2014-11-28  1029   /

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [next:master 10155/10387] drivers/gpu/drm/i915/i915_gem.c:4874 i915_gem_init() warn: inconsistent returns 'mutex:dev-struct_mutex'.

2014-12-02 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e85db7e77c6801b854864ee65c264be164dd02c1
commit: 372ee59699d9704086dadb084209542d10e28851 [10155/10387] drm/i915: Only 
init engines once

New smatch warnings:
drivers/gpu/drm/i915/i915_gem.c:4874 i915_gem_init() warn: inconsistent returns 
'mutex:dev-struct_mutex'.
  Locked on:   line 4860
  Unlocked on: line 4847

git remote add next 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout 372ee59699d9704086dadb084209542d10e28851
vim +4874 drivers/gpu/drm/i915/i915_gem.c

372ee596 Daniel Vetter 2014-11-20  4858 ret = 
dev_priv-gt.init_rings(dev);
372ee596 Daniel Vetter 2014-11-20  4859 if (ret)
372ee596 Daniel Vetter 2014-11-20  4860 return ret;

There should be a mutex_unlock() on this path I think.

372ee596 Daniel Vetter 2014-11-20  4861  
1070a42b Chris Wilson  2012-04-24  4862 ret = i915_gem_init_hw(dev);
60990320 Chris Wilson  2014-04-09  4863 if (ret == -EIO) {
60990320 Chris Wilson  2014-04-09  4864 /* Allow ring 
initialisation to fail by marking the GPU as
60990320 Chris Wilson  2014-04-09  4865  * wedged. But we only 
want to do this where the GPU is angry,
60990320 Chris Wilson  2014-04-09  4866  * for all other 
failure, such as an allocation failure, bail.
60990320 Chris Wilson  2014-04-09  4867  */
60990320 Chris Wilson  2014-04-09  4868 DRM_ERROR(Failed to 
initialize GPU, declaring it wedged\n);
60990320 Chris Wilson  2014-04-09  4869 
atomic_set_mask(I915_WEDGED, dev_priv-gpu_error.reset_counter);
60990320 Chris Wilson  2014-04-09  4870 ret = 0;
1070a42b Chris Wilson  2012-04-24  4871 }
60990320 Chris Wilson  2014-04-09  4872 
mutex_unlock(dev-struct_mutex);
1070a42b Chris Wilson  2012-04-24  4873  
60990320 Chris Wilson  2014-04-09 @4874 return ret;
1070a42b Chris Wilson  2012-04-24  4875  }
1070a42b Chris Wilson  2012-04-24  4876  
8187a2b7 Zou Nan hai   2010-05-21  4877  void
8187a2b7 Zou Nan hai   2010-05-21  4878  i915_gem_cleanup_ringbuffer(struct 
drm_device *dev)
8187a2b7 Zou Nan hai   2010-05-21  4879  {
3e31c6c0 Jani Nikula   2014-03-31  4880 struct drm_i915_private 
*dev_priv = dev-dev_private;
a4872ba6 Oscar Mateo   2014-05-22  4881 struct intel_engine_cs *ring;
1ec14ad3 Chris Wilson  2010-12-04  4882 int i;

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [net-next:master 1271/1277] drivers/net/ethernet/rocker/rocker.c:3078 rocker_port_fdb() warn: passing freed memory 'fdb'

2014-12-03 Thread Dan Carpenter
False positives.

regards,
dan carpenter

On Wed, Dec 03, 2014 at 03:28:58PM +0800, kbuild test robot wrote:
 TO: Scott Feldman sfel...@gmail.com
 CC: Jiri Pirko j...@resnulli.us
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
 master
 head:   d8febb77b52ebddb9bd03ccaa5b61005e3a45a85
 commit: 6c7079450071f889b4c2b55f8d030b1a5e859401 [1271/1277] rocker: 
 implement L2 bridge offloading
 :: branch date: 3 hours ago
 :: commit date: 3 hours ago
 
 New smatch warnings:
 drivers/net/ethernet/rocker/rocker.c:3078 rocker_port_fdb() warn: passing 
 freed memory 'fdb'
 
 Old smatch warnings:
 drivers/net/ethernet/rocker/rocker.c:1242 rocker_port_set_enable() warn: 
 should '1  rocker_port-lport' be a 64 bit type?
 drivers/net/ethernet/rocker/rocker.c:2375 rocker_flow_tbl_bridge() warn: 
 maybe use  instead of 
 drivers/net/ethernet/rocker/rocker.c:2377 rocker_flow_tbl_bridge() warn: 
 maybe use  instead of 
 drivers/net/ethernet/rocker/rocker.c:2381 rocker_flow_tbl_bridge() warn: add 
 some parenthesis here?
 drivers/net/ethernet/rocker/rocker.c:2381 rocker_flow_tbl_bridge() warn: 
 maybe use  instead of 
 drivers/net/ethernet/rocker/rocker.c:2383 rocker_flow_tbl_bridge() warn: add 
 some parenthesis here?
 drivers/net/ethernet/rocker/rocker.c:2383 rocker_flow_tbl_bridge() warn: 
 maybe use  instead of 
 drivers/net/ethernet/rocker/rocker.c:2385 rocker_flow_tbl_bridge() warn: add 
 some parenthesis here?
 
 git remote add net-next 
 git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
 git remote update net-next
 git checkout 6c7079450071f889b4c2b55f8d030b1a5e859401
 vim +/fdb +3078 drivers/net/ethernet/rocker/rocker.c
 
 6c707945 Scott Feldman 2014-11-28  3062  
 6c707945 Scott Feldman 2014-11-28  3063   
 spin_lock_irqsave(rocker-fdb_tbl_lock, lock_flags);
 6c707945 Scott Feldman 2014-11-28  3064  
 6c707945 Scott Feldman 2014-11-28  3065   found = 
 rocker_fdb_tbl_find(rocker, fdb);
 6c707945 Scott Feldman 2014-11-28  3066  
 6c707945 Scott Feldman 2014-11-28  3067   if (removing  found) {
 6c707945 Scott Feldman 2014-11-28  3068   kfree(fdb);
 6c707945 Scott Feldman 2014-11-28  3069   hash_del(found-entry);
 6c707945 Scott Feldman 2014-11-28  3070   } else if (!removing  !found) 
 {
 6c707945 Scott Feldman 2014-11-28  3071   
 hash_add(rocker-fdb_tbl, fdb-entry, fdb-key_crc32);
 6c707945 Scott Feldman 2014-11-28  3072   }
 6c707945 Scott Feldman 2014-11-28  3073  
 6c707945 Scott Feldman 2014-11-28  3074   
 spin_unlock_irqrestore(rocker-fdb_tbl_lock, lock_flags);
 6c707945 Scott Feldman 2014-11-28  3075  
 6c707945 Scott Feldman 2014-11-28  3076   /* Check if adding and already 
 exists, or removing and can't find */
 6c707945 Scott Feldman 2014-11-28  3077   if (!found != !removing) {
 6c707945 Scott Feldman 2014-11-28 @3078   kfree(fdb);
 6c707945 Scott Feldman 2014-11-28  3079   if (!found  removing)
 6c707945 Scott Feldman 2014-11-28  3080   return 0;
 6c707945 Scott Feldman 2014-11-28  3081   /* Refreshing existing 
 to update aging timers */
 6c707945 Scott Feldman 2014-11-28  3082   flags |= 
 ROCKER_OP_FLAG_REFRESH;
 6c707945 Scott Feldman 2014-11-28  3083   }
 6c707945 Scott Feldman 2014-11-28  3084  
 6c707945 Scott Feldman 2014-11-28  3085   return 
 rocker_port_fdb_learn(rocker_port, flags, addr, vlan_id);
 6c707945 Scott Feldman 2014-11-28  3086  }
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [vireshk2:thermal/cpu-cooling-fixes-v2 17/26] drivers/thermal/cpu_cooling.c:445 __cpufreq_cooling_register() warn: possible memory leak of 'cpufreq_dev'

2014-12-03 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/linux.git 
thermal/cpu-cooling-fixes-v2
head:   21e01abf4ec62501f6ffc4dd6096563de6351101
commit: 5232c1a51357b9258a02b8ca4252b7614059f19d [17/26] thermal: cpu_cooling: 
initialize 'cpufreq_val' on registration

drivers/thermal/cpu_cooling.c:445 __cpufreq_cooling_register() warn: possible 
memory leak of 'cpufreq_dev'

git remote add vireshk2 
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/linux.git
git remote update vireshk2
git checkout 5232c1a51357b9258a02b8ca4252b7614059f19d
vim +/cpufreq_dev +445 drivers/thermal/cpu_cooling.c

21a29c0e Viresh Kumar2014-11-28  429struct cpufreq_cooling_device 
*cpufreq_dev;
02361418 Amit Daniel Kachhap 2012-08-16  430char 
dev_name[THERMAL_NAME_LENGTH];
6eae693e Viresh Kumar2014-12-03  431int ret;
02361418 Amit Daniel Kachhap 2012-08-16  432  
7b8f5ba7 Eduardo Valentin2014-11-28  433if 
(!cpufreq_frequency_get_table(cpumask_first(clip_cpus))) {
7b8f5ba7 Eduardo Valentin2014-11-28  434pr_debug(%s: CPUFreq 
table not found\n, __func__);
7b8f5ba7 Eduardo Valentin2014-11-28  435return 
ERR_PTR(-EPROBE_DEFER);
7b8f5ba7 Eduardo Valentin2014-11-28  436}
7b8f5ba7 Eduardo Valentin2014-11-28  437  
baf9a155 Viresh Kumar2014-11-27  438cpufreq_dev = 
kzalloc(sizeof(*cpufreq_dev), GFP_KERNEL);
02361418 Amit Daniel Kachhap 2012-08-16  439if (!cpufreq_dev)
02361418 Amit Daniel Kachhap 2012-08-16  440return ERR_PTR(-ENOMEM);
02361418 Amit Daniel Kachhap 2012-08-16  441  
5232c1a5 Viresh Kumar2014-12-03  442cpufreq_dev-cpufreq_val = 
get_cpu_frequency(cpumask_any(clip_cpus), 0);
5232c1a5 Viresh Kumar2014-12-03  443if (!cpufreq_dev-cpufreq_val) {
5232c1a5 Viresh Kumar2014-12-03  444pr_err(%s: Failed to 
get frequency, __func__);
5232c1a5 Viresh Kumar2014-12-03 @445return ERR_PTR(-EINVAL);
5232c1a5 Viresh Kumar2014-12-03  446}
5232c1a5 Viresh Kumar2014-12-03  447  
02361418 Amit Daniel Kachhap 2012-08-16  448
cpumask_copy(cpufreq_dev-allowed_cpus, clip_cpus);
02361418 Amit Daniel Kachhap 2012-08-16  449  
02361418 Amit Daniel Kachhap 2012-08-16  450ret = get_idr(cpufreq_idr, 
cpufreq_dev-id);
02361418 Amit Daniel Kachhap 2012-08-16  451if (ret) {
9597eda0 Viresh Kumar2014-11-27  452cool_dev = ERR_PTR(ret);
9597eda0 Viresh Kumar2014-11-27  453goto free_cdev;

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [ux500:buildtest 3/4] drivers/video/backlight/lp855x_bl.c:421 lp855x_probe() error: we previously assumed 'lp-pdata' could be null (see line 415)

2014-12-03 Thread Dan Carpenter
False positive. Because CONFIG_OF is turned off so we're using this:

#else
static int lp855x_parse_dt(struct lp855x *lp)
{
return -EINVAL;
}
#endif

It's probably going to take a year before I get around to fixing these
sorts of issues.

regards,
dan carpenter

On Wed, Dec 03, 2014 at 05:46:13PM +0800, kbuild test robot wrote:
 TO: Sean Paul seanp...@chromium.org
 CC: Lee Jones lee.jo...@linaro.org
 
 tree:   https://git.linaro.org/people/ljones/linux-3.0-ux500.git buildtest
 head:   a98549c2b76ac35de913e9602d02546da6bac761
 commit: ca92ac756e5e116a380cd56f8927281dedd9f02d [3/4] backlight: lp855x: 
 Refactor DT parsing code
 :: branch date: 42 minutes ago
 :: commit date: 42 minutes ago
 
 drivers/video/backlight/lp855x_bl.c:421 lp855x_probe() error: we previously 
 assumed 'lp-pdata' could be null (see line 415)
 
 git remote add ux500 https://git.linaro.org/people/ljones/linux-3.0-ux500.git
 git remote update ux500
 git checkout ca92ac756e5e116a380cd56f8927281dedd9f02d
 vim +421 drivers/video/backlight/lp855x_bl.c
 
 7be865ab86 Kim, Milo 2012-03-23  409  lp-client = cl;
 7be865ab86 Kim, Milo 2012-03-23  410  lp-dev = cl-dev;
 7be865ab86 Kim, Milo 2012-03-23  411  lp-chipname = id-name;
 7be865ab86 Kim, Milo 2012-03-23  412  lp-chip_id = id-driver_data;
 ca92ac756e Sean Paul 2014-12-02  413  lp-pdata = 
 dev_get_platdata(cl-dev);
 ca92ac756e Sean Paul 2014-12-02  414  
 ca92ac756e Sean Paul 2014-12-02 @415  if (!lp-pdata) {
 ca92ac756e Sean Paul 2014-12-02  416  ret = 
 lp855x_parse_dt(lp);
 ca92ac756e Sean Paul 2014-12-02  417  if (ret  0)
 ca92ac756e Sean Paul 2014-12-02  418  return ret;
 ca92ac756e Sean Paul 2014-12-02  419  }
 ca92ac756e Sean Paul 2014-12-02  420  
 ca92ac756e Sean Paul 2014-12-02 @421  if (lp-pdata-period_ns  0)
 ca92ac756e Sean Paul 2014-12-02  422  lp-mode = PWM_BASED;
 ca92ac756e Sean Paul 2014-12-02  423  else
 ca92ac756e Sean Paul 2014-12-02  424  lp-mode = 
 REGISTER_BASED;
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [patch] dell-laptop: fix kbd_timeout handling

2014-12-04 Thread Dan Carpenter
On Tue, Dec 02, 2014 at 11:33:25PM -0800, Darren Hart wrote:

 Dan, any objection to Pali rolling this into another revision?

No problem, that's fine.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] drivers/nfc/st21nfcb/ndlc.c:296:1-6: WARNING: invalid free of devm_ allocated data

2014-12-04 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3a18ca061311f2f1ee9c44012f89c7436d392117
commit: 35630df68d6030daf12dde12ed07bbe26324e6ac NFC: st21nfcb: Add driver for 
STMicroelectronics ST21NFCB NFC chip

 drivers/nfc/st21nfcb/ndlc.c:296:1-6: WARNING: invalid free of devm_ 
 allocated data

git remote add linus 
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git remote update linus
git checkout 35630df68d6030daf12dde12ed07bbe26324e6ac
vim +296 drivers/nfc/st21nfcb/ndlc.c

35630df6 Christophe Ricard 2014-05-25  280  return st21nfcb_nci_probe(ndlc, 
phy_headroom, phy_tailroom);
35630df6 Christophe Ricard 2014-05-25  281  }
35630df6 Christophe Ricard 2014-05-25  282  EXPORT_SYMBOL(ndlc_probe);
35630df6 Christophe Ricard 2014-05-25  283  
35630df6 Christophe Ricard 2014-05-25  284  void ndlc_remove(struct llt_ndlc 
*ndlc)
35630df6 Christophe Ricard 2014-05-25  285  {
35630df6 Christophe Ricard 2014-05-25  286  /* cancel timers */
35630df6 Christophe Ricard 2014-05-25  287  del_timer_sync(ndlc-t1_timer);
35630df6 Christophe Ricard 2014-05-25  288  del_timer_sync(ndlc-t2_timer);
35630df6 Christophe Ricard 2014-05-25  289  ndlc-t2_active = false;
35630df6 Christophe Ricard 2014-05-25  290  ndlc-t1_active = false;
35630df6 Christophe Ricard 2014-05-25  291  
35630df6 Christophe Ricard 2014-05-25  292  skb_queue_purge(ndlc-rcv_q);
35630df6 Christophe Ricard 2014-05-25  293  skb_queue_purge(ndlc-send_q);
35630df6 Christophe Ricard 2014-05-25  294  
35630df6 Christophe Ricard 2014-05-25  295  st21nfcb_nci_remove(ndlc-ndev);
35630df6 Christophe Ricard 2014-05-25 @296  kfree(ndlc);
35630df6 Christophe Ricard 2014-05-25  297  }
35630df6 Christophe Ricard 2014-05-25  298  EXPORT_SYMBOL(ndlc_remove);

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [next:master 5834/10887] drivers/gpu/drm/drm_mipi_dsi.c:281 mipi_dsi_create_packet() warn: variable dereferenced before check 'msg' (see line 279)

2014-12-05 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   1ca7c606de868d172afb4eb65e04e290dbdb51ff
commit: a52879e8d7cbeed69be5e54c69701e5edea8cc00 [5834/10887] drm/dsi: Add 
message to packet translator

drivers/gpu/drm/drm_mipi_dsi.c:281 mipi_dsi_create_packet() warn: variable 
dereferenced before check 'msg' (see line 279)

git remote add next 
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update next
git checkout a52879e8d7cbeed69be5e54c69701e5edea8cc00
vim +/msg +281 drivers/gpu/drm/drm_mipi_dsi.c

a52879e8 Thierry Reding 2014-10-16  273   *
a52879e8 Thierry Reding 2014-10-16  274   * Return: 0 on success or a negative 
error code on failure.
a52879e8 Thierry Reding 2014-10-16  275   */
a52879e8 Thierry Reding 2014-10-16  276  int mipi_dsi_create_packet(struct 
mipi_dsi_packet *packet,
a52879e8 Thierry Reding 2014-10-16  277const struct 
mipi_dsi_msg *msg)
a52879e8 Thierry Reding 2014-10-16  278  {
a52879e8 Thierry Reding 2014-10-16 @279 const u8 *tx = msg-tx_buf;
a52879e8 Thierry Reding 2014-10-16  280  
a52879e8 Thierry Reding 2014-10-16 @281 if (!packet || !msg)
a52879e8 Thierry Reding 2014-10-16  282 return -EINVAL;
a52879e8 Thierry Reding 2014-10-16  283  
a52879e8 Thierry Reding 2014-10-16  284 /* do some minimum sanity 
checking */

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [netdev-next:master 16/16] drivers/net/ethernet/intel/i40e/i40e_debugfs.c:832 i40e_dbg_dump_desc() warn: possible memory leak of 'ring'

2014-12-06 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next.git 
master
head:   e6c97234d1b18d4751671df15d52e29daa8a7ba8
commit: e6c97234d1b18d4751671df15d52e29daa8a7ba8 [16/16] i40e: Reduce stack in 
i40e_dbg_dump_desc

New smatch warnings:
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:832 i40e_dbg_dump_desc() warn: 
possible memory leak of 'ring'

Old smatch warnings:
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:107 i40e_dbg_dump_read() warn: 
maybe return -EFAULT instead of the bytes remaining?
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:357 i40e_dbg_command_read() 
warn: maybe return -EFAULT instead of the bytes remaining?
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:386 i40e_dbg_dump_vsi_seid() 
warn: this array is probably non-NULL. 'vsi-active_vlans'
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:991 i40e_dbg_command_write() 
warn: maybe return -EFAULT instead of the bytes remaining?
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:1971 i40e_dbg_netdev_ops_read() 
warn: maybe return -EFAULT instead of the bytes remaining?
drivers/net/ethernet/intel/i40e/i40e_debugfs.c:2005 i40e_dbg_netdev_ops_write() 
warn: maybe return -EFAULT instead of the bytes remaining?

git remote add netdev-next 
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next.git
git remote update netdev-next
git checkout e6c97234d1b18d4751671df15d52e29daa8a7ba8
vim +/ring +832 drivers/net/ethernet/intel/i40e/i40e_debugfs.c

68bf94aa Shannon Nelson   2014-01-15  816   
d[%03i] = 0x%016llx 0x%016llx\n,
68bf94aa Shannon Nelson   2014-01-15  817   
 i, rxd-read.pkt_addr,
68bf94aa Shannon Nelson   2014-01-15  818   
 rxd-read.hdr_addr);
68bf94aa Shannon Nelson   2014-01-15  819   } else {
e6c97234 Joe Perches  2014-11-18  820   rxd = 
I40E_RX_DESC(ring, i);
02e9c290 Jesse Brandeburg 2013-09-11  821   
dev_info(pf-pdev-dev,
02e9c290 Jesse Brandeburg 2013-09-11  822   
d[%03i] = 0x%016llx 0x%016llx 0x%016llx 0x%016llx\n,
68bf94aa Shannon Nelson   2014-01-15  823   
 i, rxd-read.pkt_addr,
68bf94aa Shannon Nelson   2014-01-15  824   
 rxd-read.hdr_addr,
68bf94aa Shannon Nelson   2014-01-15  825   
 rxd-read.rsvd1, rxd-read.rsvd2);
68bf94aa Shannon Nelson   2014-01-15  826   }
02e9c290 Jesse Brandeburg 2013-09-11  827   }
02e9c290 Jesse Brandeburg 2013-09-11  828   } else if (cnt == 3) {
e6c97234 Joe Perches  2014-11-18  829   if (desc_n = 
ring-count || desc_n  0) {
02e9c290 Jesse Brandeburg 2013-09-11  830   
dev_info(pf-pdev-dev,
02e9c290 Jesse Brandeburg 2013-09-11  831
descriptor %d not found\n, desc_n);
02e9c290 Jesse Brandeburg 2013-09-11 @832   return;
02e9c290 Jesse Brandeburg 2013-09-11  833   }
68bf94aa Shannon Nelson   2014-01-15  834   if (!is_rx_ring) {
e6c97234 Joe Perches  2014-11-18  835   txd = 
I40E_TX_DESC(ring, desc_n);
02e9c290 Jesse Brandeburg 2013-09-11  836   
dev_info(pf-pdev-dev,
68bf94aa Shannon Nelson   2014-01-15  837vsi = 
%02i tx ring = %02i d[%03i] = 0x%016llx 0x%016llx\n,
68bf94aa Shannon Nelson   2014-01-15  838
vsi_seid, ring_id, desc_n,
68bf94aa Shannon Nelson   2014-01-15  839
txd-buffer_addr, txd-cmd_type_offset_bsz);
68bf94aa Shannon Nelson   2014-01-15  840   } else if (sizeof(union 
i40e_rx_desc) ==

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 1345/1380] net/tipc/name_table.c:980 tipc_purge_publications() error: double lock 'spin_lock:seq-lock'

2014-12-08 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   bc6aaa14e11304b629ae8b0c0c71737cf24114b7
commit: fb9962f3cefeba8c5addc96dceb8bc360062ab50 [1345/1380] tipc: ensure all 
name sequences are properly protected with its lock

net/tipc/name_table.c:980 tipc_purge_publications() error: double lock 
'spin_lock:seq-lock'

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout fb9962f3cefeba8c5addc96dceb8bc360062ab50
vim +980 net/tipc/name_table.c

1bb8dce5 Erik Hugne 2014-03-06  964   */
1bb8dce5 Erik Hugne 2014-03-06  965  static void tipc_purge_publications(struct 
name_seq *seq)
1bb8dce5 Erik Hugne 2014-03-06  966  {
1bb8dce5 Erik Hugne 2014-03-06  967 struct publication *publ, *safe;
1bb8dce5 Erik Hugne 2014-03-06  968 struct sub_seq *sseq;
1bb8dce5 Erik Hugne 2014-03-06  969 struct name_info *info;
1bb8dce5 Erik Hugne 2014-03-06  970  
fb9962f3 Ying Xue   2014-12-02  971 spin_lock_bh(seq-lock);
1bb8dce5 Erik Hugne 2014-03-06  972 sseq = seq-sseqs;
1bb8dce5 Erik Hugne 2014-03-06  973 info = sseq-info;
1bb8dce5 Erik Hugne 2014-03-06  974 list_for_each_entry_safe(publ, safe, 
info-zone_list, zone_list) {
1bb8dce5 Erik Hugne 2014-03-06  975 
tipc_nametbl_remove_publ(publ-type, publ-lower, publ-node,
1bb8dce5 Erik Hugne 2014-03-06  976  
publ-ref, publ-key);
1621b94d Ying Xue   2014-04-29  977 kfree(publ);
1bb8dce5 Erik Hugne 2014-03-06  978 }
38622f41 Ying Xue   2014-12-02  979 hlist_del_init(seq-ns_list);
fb9962f3 Ying Xue   2014-12-02 @980 spin_lock_bh(seq-lock);
fb9962f3 Ying Xue   2014-12-02  981  
38622f41 Ying Xue   2014-12-02  982 kfree(seq-sseqs);
38622f41 Ying Xue   2014-12-02  983 kfree(seq);
1bb8dce5 Erik Hugne 2014-03-06  984  }
1bb8dce5 Erik Hugne 2014-03-06  985  
4323add6 Per Liden  2006-01-18  986  void tipc_nametbl_stop(void)
b97bf3fd Per Liden  2006-01-02  987  {
b97bf3fd Per Liden  2006-01-02  988 u32 i;

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 1404/1409] drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c:489 t4_bar2_sge_qregs() warn: should '(qid qpp_shift) page_shift' be a 64 bit type?

2014-12-10 Thread Dan Carpenter
[ It's weird to have a 64 bit offset into anything but the code is very
  consistent about this.  The comments mention that often the values are
  less that PAGE_SIZE.  My guess is that the type should be changed to
  u32, but if we don't do that, then we should at least silence the
  static checker warning by casting the shift.  - dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   395eea6ccf2b253f81b4718ffbcae67d36fe2e69
commit: e85c9a7abfa407ed99f8516cf6a10d397247315a [1404/1409] cxgb4/cxgb4vf: Add 
code to calculate T5 BAR2 Offsets for SGE Queue Registers

drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c:489 t4_bar2_sge_qregs() warn: 
should '(qid  qpp_shift)  page_shift' be a 64 bit type?
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c:4062 t4_bar2_sge_qregs() warn: 
should '(qid  qpp_shift)  page_shift' be a 64 bit type?

git remote add net-next 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout e85c9a7abfa407ed99f8516cf6a10d397247315a
vim +489 drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c

e85c9a7a Hariprasad Shenai 2014-12-03  473   */
e85c9a7a Hariprasad Shenai 2014-12-03  474  page_shift = 
adapter-params.sge.sge_vf_hps + 10;
e85c9a7a Hariprasad Shenai 2014-12-03  475  page_size = 1  page_shift;
e85c9a7a Hariprasad Shenai 2014-12-03  476  
e85c9a7a Hariprasad Shenai 2014-12-03  477  /* Get the right Queues per 
Page parameters for our Queue.
e85c9a7a Hariprasad Shenai 2014-12-03  478   */
e85c9a7a Hariprasad Shenai 2014-12-03  479  qpp_shift = (qtype == 
T4_BAR2_QTYPE_EGRESS
e85c9a7a Hariprasad Shenai 2014-12-03  480   ? 
adapter-params.sge.sge_vf_eq_qpp
e85c9a7a Hariprasad Shenai 2014-12-03  481   : 
adapter-params.sge.sge_vf_iq_qpp);
e85c9a7a Hariprasad Shenai 2014-12-03  482  qpp_mask = (1  qpp_shift) - 1;
e85c9a7a Hariprasad Shenai 2014-12-03  483  
e85c9a7a Hariprasad Shenai 2014-12-03  484  /* Calculate the basics of the 
BAR2 SGE Queue register area:
e85c9a7a Hariprasad Shenai 2014-12-03  485   *  o The BAR2 page the Queue 
registers will be in.
e85c9a7a Hariprasad Shenai 2014-12-03  486   *  o The BAR2 Queue ID.
e85c9a7a Hariprasad Shenai 2014-12-03  487   *  o The BAR2 Queue ID Offset 
into the BAR2 page.
e85c9a7a Hariprasad Shenai 2014-12-03  488   */
e85c9a7a Hariprasad Shenai 2014-12-03 @489  bar2_page_offset = ((qid  
qpp_shift)  page_shift);
e85c9a7a Hariprasad Shenai 2014-12-03  490  bar2_qid = qid  qpp_mask;
e85c9a7a Hariprasad Shenai 2014-12-03  491  bar2_qid_offset = bar2_qid * 
SGE_UDB_SIZE;
e85c9a7a Hariprasad Shenai 2014-12-03  492  
e85c9a7a Hariprasad Shenai 2014-12-03  493  /* If the BAR2 Queue ID Offset 
is less than the Page Size, then the
e85c9a7a Hariprasad Shenai 2014-12-03  494   * hardware will infer the 
Absolute Queue ID simply from the writes to
e85c9a7a Hariprasad Shenai 2014-12-03  495   * the BAR2 Queue ID Offset 
within the BAR2 Page (and we need to use a
e85c9a7a Hariprasad Shenai 2014-12-03  496   * BAR2 Queue ID of 0 for those 
writes).  Otherwise, we'll simply
e85c9a7a Hariprasad Shenai 2014-12-03  497   * write to the first BAR2 SGE 
Queue Area within the BAR2 Page with

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 11322/11577] drivers/input/touchscreen/elants_i2c.c:877 elants_i2c_irq() warn: missing break? reassigning 'ts-state'

2014-12-10 Thread Dan Carpenter
This is a false positive.

On Wed, Dec 10, 2014 at 02:36:50AM +0800, kbuild test robot wrote:
 
 66aee900 Scott Liu 2014-11-19  861/* fall through */

Smatch should eventually be updated to grep for the fall through
comments...

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [drm-intel:topic/core-stuff 32/37] drivers/gpu/drm/drm_crtc.c:4472 drm_mode_crtc_set_gamma_size() warn: double check that we're allocating correct size: 2 vs 6

2014-12-10 Thread Dan Carpenter
On Wed, Dec 10, 2014 at 03:53:30PM +0100, Daniel Vetter wrote:
 On Wed, Dec 10, 2014 at 3:03 PM, Dan Carpenter dan.carpen...@oracle.com 
 wrote:
  From a style prespective this should be:
 
  crtc-gamma_store = kcalloc(gamma_size * 3, sizeof(uint16_t),
  GFP_KERNEL);
 
  Because the elements are sizeof(uint16_t), we are allocating 3
  arrays of gamma_size elements.  But I guess it's nice to move all the
  constants to one side of the equation so that it tests for integer
  overflows...  Whatever you decided is fine, this is a one time email
  that is auto-genenerated.
 
 Imo the point of kcalloc and kmalloc_array is to get the overflow
 checks correct. Putting the *3 to the gamma_size (which can be fairly
 big and migth come from dubios places) means we still have to deal
 with overflow headaches. sizeof(uint16_t)*3 is trivial to see that
 it's not overflowing.
 
 I think your style guide here is exactly _not_ what we should do as
 best practice for safe code.
 -Daniel

It's an unusual thing to allocate 3 arrays at the same time is all.  It
confused the static checker and took a while to figure out.  But I can
also see the point about what I wrote about moving the constants so
that's fine too.  I'm correct either way.  :)

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [next:master 11322/11577] drivers/input/touchscreen/elants_i2c.c:877 elants_i2c_irq() warn: missing break? reassigning 'ts-state'

2014-12-10 Thread Dan Carpenter
On Wed, Dec 10, 2014 at 01:59:01PM -0800, Fengguang Wu wrote:
 On Wed, Dec 10, 2014 at 01:24:10PM +0300, Dan Carpenter wrote:
  This is a false positive.
  
  On Wed, Dec 10, 2014 at 02:36:50AM +0800, kbuild test robot wrote:
   
   66aee900 Scott Liu 2014-11-19  861/* fall through */
  
  Smatch should eventually be updated to grep for the fall through
  comments...
 
 It'd be convenient for me to grep that fall through in scripts.
 Shall I do it?

Hm...  You would grep maybe 10 lines plus/minus around the warning?

That would work I suppose.

regards,
dan carpenter

___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [daniel.lezcano:chromebook2 10152/10189] drivers/input/touchscreen/atmel_mxt_ts.c:1592 mxt_get_object_table() warn: assigning (-2) to unsigned variable 'data-num_touchids'

2014-12-13 Thread Dan Carpenter
So long as we trust the firmware to give good data then this code is
fine.

regards,
dan carpenter

On Sat, Dec 13, 2014 at 12:10:16AM +0800, kbuild test robot wrote:
 TO: Nick Dyer nick.d...@itdev.co.uk
 CC: Kevin Hilman khil...@linaro.org
 CC: Javier Martinez Canillas javier.marti...@collabora.co.uk
 
 tree:   https://git.linaro.org/people/daniel.lezcano/linux chromebook2
 head:   4002075ccb928a8b1d02e8067b36591ecfc9bab5
 commit: 06b74cff1f9b3714be351a2e864a8903ae3b6f1e [10152/10189] Input: 
 atmel_mxt_ts - implement support for T100 touch object
 :: branch date: 22 hours ago
 :: commit date: 3 days ago
 
 drivers/input/touchscreen/atmel_mxt_ts.c:1592 mxt_get_object_table() warn: 
 assigning (-2) to unsigned variable 'data-num_touchids'
 drivers/input/touchscreen/atmel_mxt_ts.c:1875 
 mxt_initialize_t100_input_device() warn: variable dereferenced before check 
 'data' (see line 1866)
 
 git remote add daniel.lezcano 
 https://git.linaro.org/people/daniel.lezcano/linux
 git remote update daniel.lezcano
 git checkout 06b74cff1f9b3714be351a2e864a8903ae3b6f1e
 vim +1592 drivers/input/touchscreen/atmel_mxt_ts.c
 
 333e5a9a drivers/input/touchscreen/atmel_mxt_ts.c Daniel Kurtz   2012-06-28  
 1576 case MXT_TOUCH_MULTI_T9:
 333e5a9a drivers/input/touchscreen/atmel_mxt_ts.c Daniel Kurtz   2012-06-28  
 1577 data-T9_reportid_min = min_id;
 333e5a9a drivers/input/touchscreen/atmel_mxt_ts.c Daniel Kurtz   2012-06-28  
 1578 data-T9_reportid_max = max_id;
 9d8dc3e5 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1579 data-num_touchids = object-num_report_ids
 9d8dc3e5 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1580 * mxt_obj_instances(object);
 9d8dc3e5 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1581 break;
 9d8dc3e5 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1582 case MXT_SPT_MESSAGECOUNT_T44:
 9d8dc3e5 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1583 data-T44_address = object-start_address;
 333e5a9a drivers/input/touchscreen/atmel_mxt_ts.c Daniel Kurtz   2012-06-28  
 1584 break;
 22dfab7f drivers/input/touchscreen/atmel_mxt_ts.c Daniel Kurtz   2013-03-07  
 1585 case MXT_SPT_GPIOPWM_T19:
 22dfab7f drivers/input/touchscreen/atmel_mxt_ts.c Daniel Kurtz   2013-03-07  
 1586 data-T19_reportid = min_id;
 22dfab7f drivers/input/touchscreen/atmel_mxt_ts.c Daniel Kurtz   2013-03-07  
 1587 break;
 06b74cff drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-08-27  
 1588 case MXT_TOUCH_MULTITOUCHSCREEN_T100:
 06b74cff drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-08-27  
 1589 data-T100_reportid_min = min_id;
 06b74cff drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-08-27  
 1590 data-T100_reportid_max = max_id;
 06b74cff drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-08-27  
 1591 /* first two report IDs reserved */
 06b74cff drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-08-27 
 @1592 data-num_touchids = object-num_report_ids - 2;
 06b74cff drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-08-27  
 1593 break;
 4cf51c38 drivers/input/touchscreen/qt602240_ts.c  Joonyoung Shim 2010-07-14  
 1594 }
 4ce6fa01 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1595  
 4ce6fa01 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1596 end_address = object-start_address
 4ce6fa01 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1597 + mxt_obj_size(object) * mxt_obj_instances(object) - 
 1;
 4ce6fa01 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1598  
 4ce6fa01 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1599 if (end_address = data-mem_size)
 4ce6fa01 drivers/input/touchscreen/atmel_mxt_ts.c Nick Dyer  2014-07-23  
 1600 data-mem_size = end_address + 1;
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [tixy:tracking-armlt-gator 1/6] drivers/gator/gator_events_perf_pmu.c:241 __start() warn: returning -1 instead of -ENOMEM is sloppy

2014-12-16 Thread Dan Carpenter
tree:   https://git.linaro.org/people/tixy/kernel tracking-armlt-gator
head:   9b552ac355654e1fdd504f4b84b57c971084d83e
commit: a7bdf015d9043286f35de13eb11f54f64f2af143 [1/6] gator: Version 5.20

drivers/gator/gator_events_perf_pmu.c:241 __start() warn: returning -1 instead 
of -ENOMEM is sloppy

git remote add tixy https://git.linaro.org/people/tixy/kernel
git remote update tixy
git checkout a7bdf015d9043286f35de13eb11f54f64f2af143
vim +241 drivers/gator/gator_events_perf_pmu.c

a7bdf015 Jon Medhurst 2014-10-30  225  
a7bdf015 Jon Medhurst 2014-10-30  226  static int __start(struct gator_attr 
*const attr, struct gator_event *const event)
a7bdf015 Jon Medhurst 2014-10-30  227  {
a7bdf015 Jon Medhurst 2014-10-30  228   u32 size = sizeof(struct 
perf_event_attr);
a7bdf015 Jon Medhurst 2014-10-30  229  
a7bdf015 Jon Medhurst 2014-10-30  230   event-pevent = NULL;
a7bdf015 Jon Medhurst 2014-10-30  231   /* Skip disabled counters */
a7bdf015 Jon Medhurst 2014-10-30  232   if (!attr-enabled)
a7bdf015 Jon Medhurst 2014-10-30  233   return 0;
a7bdf015 Jon Medhurst 2014-10-30  234  
a7bdf015 Jon Medhurst 2014-10-30  235   event-prev = 0;
a7bdf015 Jon Medhurst 2014-10-30  236   event-curr = 0;
a7bdf015 Jon Medhurst 2014-10-30  237   event-prev_delta = 0;
a7bdf015 Jon Medhurst 2014-10-30  238   event-pevent_attr = kmalloc(size, 
GFP_KERNEL);
a7bdf015 Jon Medhurst 2014-10-30  239   if (!event-pevent_attr) {
a7bdf015 Jon Medhurst 2014-10-30  240   gator_events_perf_pmu_stop();
a7bdf015 Jon Medhurst 2014-10-30 @241   return -1;
a7bdf015 Jon Medhurst 2014-10-30  242   }
a7bdf015 Jon Medhurst 2014-10-30  243  
a7bdf015 Jon Medhurst 2014-10-30  244   memset(event-pevent_attr, 0, size);
a7bdf015 Jon Medhurst 2014-10-30  245   event-pevent_attr-type = attr-type;
a7bdf015 Jon Medhurst 2014-10-30  246   event-pevent_attr-size = size;
a7bdf015 Jon Medhurst 2014-10-30  247   event-pevent_attr-config = 
attr-event;
a7bdf015 Jon Medhurst 2014-10-30  248   event-pevent_attr-sample_period = 
attr-count;
a7bdf015 Jon Medhurst 2014-10-30  249   event-pevent_attr-pinned = 1;

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [tixy:integration-linaro-vexpress64 24/644] drivers/input/evdev.c:390 evdev_release() warn: passing freed memory 'client'

2014-12-16 Thread Dan Carpenter
tree:   https://git.linaro.org/people/tixy/kernel integration-linaro-vexpress64
head:   767452a1ba48d05ee26d47c5a5ce1f6d6589495c
commit: 6e71fda4b35e9b8b4f2f009b9d2b70214ea2db3a [24/644] Input: evdev - Add 
ioctl to block suspend while event queue is not empty.

drivers/input/evdev.c:390 evdev_release() warn: passing freed memory 'client'

git remote add tixy https://git.linaro.org/people/tixy/kernel
git remote update tixy
git checkout 6e71fda4b35e9b8b4f2f009b9d2b70214ea2db3a
vim +/client +390 drivers/input/evdev.c

d0ffb9be Dmitry Torokhov 2007-04-12  374struct evdev_client *client = 
file-private_data;
d0ffb9be Dmitry Torokhov 2007-04-12  375struct evdev *evdev = 
client-evdev;
^1da177e Linus Torvalds  2005-04-16  376  
6addb1d6 Dmitry Torokhov 2007-08-30  377mutex_lock(evdev-mutex);
6addb1d6 Dmitry Torokhov 2007-08-30  378evdev_ungrab(evdev, client);
6addb1d6 Dmitry Torokhov 2007-08-30  379mutex_unlock(evdev-mutex);
^1da177e Linus Torvalds  2005-04-16  380  
6addb1d6 Dmitry Torokhov 2007-08-30  381evdev_detach_client(evdev, 
client);
92eb77d0 Daniel Stone2013-10-31  382  
6e71fda4 Arve Hjønnevåg  2008-10-17  383if (client-use_wake_lock)
6e71fda4 Arve Hjønnevåg  2008-10-17  384
wake_lock_destroy(client-wake_lock);
6e71fda4 Arve Hjønnevåg  2008-10-17  385  
92eb77d0 Daniel Stone2013-10-31  386if (is_vmalloc_addr(client))
92eb77d0 Daniel Stone2013-10-31  387vfree(client);
92eb77d0 Daniel Stone2013-10-31  388else
d0ffb9be Dmitry Torokhov 2007-04-12  389kfree(client);
6e71fda4 Arve Hjønnevåg  2008-10-17 @390kfree(client);
^1da177e Linus Torvalds  2005-04-16  391  
6addb1d6 Dmitry Torokhov 2007-08-30  392evdev_close_device(evdev);
^1da177e Linus Torvalds  2005-04-16  393  
^1da177e Linus Torvalds  2005-04-16  394return 0;
^1da177e Linus Torvalds  2005-04-16  395  }
^1da177e Linus Torvalds  2005-04-16  396  
b58f7086 Henrik Rydberg  2010-06-23  397  static unsigned int 
evdev_compute_buffer_size(struct input_dev *dev)
b58f7086 Henrik Rydberg  2010-06-23  398  {

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [tixy:integration-linaro-vexpress64 138/644] net/netfilter/xt_IDLETIMER.c:131 idletimer_tg_show() error: we previously assumed 'timer' could be null (see line 122)

2014-12-16 Thread Dan Carpenter
tree:   https://git.linaro.org/people/tixy/kernel integration-linaro-vexpress64
head:   767452a1ba48d05ee26d47c5a5ce1f6d6589495c
commit: 1062f9781924f211b3f55b8d830ea3e489f5bab4 [138/644] netfilter: 
xt_IDLETIMER: Add new netlink msg type

net/netfilter/xt_IDLETIMER.c:131 idletimer_tg_show() error: we previously 
assumed 'timer' could be null (see line 122)

git remote add tixy https://git.linaro.org/people/tixy/kernel
git remote update tixy
git checkout 1062f9781924f211b3f55b8d830ea3e489f5bab4
vim +/timer +131 net/netfilter/xt_IDLETIMER.c

0902b469 Luciano Coelho 2010-06-15  116 unsigned long expires = 0;
1062f978 JP Abgrall 2012-04-26  117 unsigned long now = jiffies;
0902b469 Luciano Coelho 2010-06-15  118  
0902b469 Luciano Coelho 2010-06-15  119 mutex_lock(list_mutex);
0902b469 Luciano Coelho 2010-06-15  120  
0902b469 Luciano Coelho 2010-06-15  121 timer = 
__idletimer_tg_find_by_label(attr-name);
0902b469 Luciano Coelho 2010-06-15 @122 if (timer)
0902b469 Luciano Coelho 2010-06-15  123 expires = 
timer-timer.expires;
0902b469 Luciano Coelho 2010-06-15  124  
0902b469 Luciano Coelho 2010-06-15  125 mutex_unlock(list_mutex);
0902b469 Luciano Coelho 2010-06-15  126  
1062f978 JP Abgrall 2012-04-26  127 if (time_after(expires, now))
0902b469 Luciano Coelho 2010-06-15  128 return sprintf(buf, 
%u\n,
1062f978 JP Abgrall 2012-04-26  129
jiffies_to_msecs(expires - now) / 1000);
0902b469 Luciano Coelho 2010-06-15  130  
1062f978 JP Abgrall 2012-04-26 @131 if (timer-send_nl_msg)
1062f978 JP Abgrall 2012-04-26  132 return sprintf(buf, 0 
%d\n,
1062f978 JP Abgrall 2012-04-26  133 
jiffies_to_msecs(now - expires) / 1000);
1062f978 JP Abgrall 2012-04-26  134 else

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [tixy:integration-linaro-vexpress64 282/644] drivers/video/adf/adf_fbdev.c:139 adf_modeinfo_to_fb_videomode() warn: suspicious bitop condition

2014-12-16 Thread Dan Carpenter
tree:   https://git.linaro.org/people/tixy/kernel integration-linaro-vexpress64
head:   767452a1ba48d05ee26d47c5a5ce1f6d6589495c
commit: a1eadbd034a44e33191e5eefb1ca21f818bc0d43 [282/644] video: adf: add 
fbdev compatibility helper

drivers/video/adf/adf_fbdev.c:139 adf_modeinfo_to_fb_videomode() warn: 
suspicious bitop condition
drivers/video/adf/adf_fbdev.c:141 adf_modeinfo_to_fb_videomode() warn: 
suspicious bitop condition
drivers/video/adf/adf_fbdev.c:143 adf_modeinfo_to_fb_videomode() warn: 
suspicious bitop condition
drivers/video/adf/adf_fbdev.c:145 adf_modeinfo_to_fb_videomode() warn: 
suspicious bitop condition

git remote add tixy https://git.linaro.org/people/tixy/kernel
git remote update tixy
git checkout a1eadbd034a44e33191e5eefb1ca21f818bc0d43
vim +139 drivers/video/adf/adf_fbdev.c

a1eadbd0 Greg Hackmann 2013-07-09  133  vmode-upper_margin = 
mode-vtotal - mode-vsync_end;
a1eadbd0 Greg Hackmann 2013-07-09  134  vmode-lower_margin = 
mode-vsync_start - mode-vdisplay;
a1eadbd0 Greg Hackmann 2013-07-09  135  vmode-hsync_len = 
mode-hsync_end - mode-hsync_start;
a1eadbd0 Greg Hackmann 2013-07-09  136  vmode-vsync_len = 
mode-vsync_end - mode-vsync_start;
a1eadbd0 Greg Hackmann 2013-07-09  137  
a1eadbd0 Greg Hackmann 2013-07-09  138  vmode-sync = 0;
a1eadbd0 Greg Hackmann 2013-07-09 @139  if (mode-flags | 
DRM_MODE_FLAG_PHSYNC)
a1eadbd0 Greg Hackmann 2013-07-09  140  vmode-sync |= 
FB_SYNC_HOR_HIGH_ACT;
a1eadbd0 Greg Hackmann 2013-07-09 @141  if (mode-flags | 
DRM_MODE_FLAG_PVSYNC)
a1eadbd0 Greg Hackmann 2013-07-09  142  vmode-sync |= 
FB_SYNC_VERT_HIGH_ACT;
a1eadbd0 Greg Hackmann 2013-07-09 @143  if (mode-flags | 
DRM_MODE_FLAG_PCSYNC)
a1eadbd0 Greg Hackmann 2013-07-09  144  vmode-sync |= 
FB_SYNC_COMP_HIGH_ACT;
a1eadbd0 Greg Hackmann 2013-07-09 @145  if (mode-flags | 
DRM_MODE_FLAG_BCAST)
a1eadbd0 Greg Hackmann 2013-07-09  146  vmode-sync |= 
FB_SYNC_BROADCAST;
a1eadbd0 Greg Hackmann 2013-07-09  147  
a1eadbd0 Greg Hackmann 2013-07-09  148  vmode-vmode = 0;

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] drivers/mailbox/pcc.c:119 pcc_mbox_request_channel() error: 'chan' dereferencing possible ERR_PTR()

2014-12-17 Thread Dan Carpenter
I reported this one earlier.

regards,
dan carpenter


On Wed, Dec 17, 2014 at 06:05:20AM +0800, kbuild test robot wrote:
 TO: Ashwin Chaugule ashwin.chaug...@linaro.org
 CC: Jassi Brar jaswinder.si...@linaro.org
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
 master
 head:   2dbfca5a181973558277b28b1f4c36362291f5e0
 commit: 86c22f8c9a3b71d42d38bfcd80372de72f573713 Mailbox: Add support for 
 Platform Communication Channel
 date:   3 weeks ago
 :: branch date: 20 hours ago
 :: commit date: 3 weeks ago
 
 New smatch warnings:
 drivers/mailbox/pcc.c:119 pcc_mbox_request_channel() error: 'chan' 
 dereferencing possible ERR_PTR()
 
 Old smatch warnings:
 drivers/mailbox/pcc.c:220 pcc_send_data() warn: impossible condition '(ss_idx 
  0) = (0-65535  0)'
 
 git remote add linus 
 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
 git remote update linus
 git checkout 86c22f8c9a3b71d42d38bfcd80372de72f573713
 vim +/chan +119 drivers/mailbox/pcc.c
 
 86c22f8c Ashwin Chaugule 2014-11-12  103  struct mbox_chan 
 *pcc_mbox_request_channel(struct mbox_client *cl,
 86c22f8c Ashwin Chaugule 2014-11-12  104  int subspace_id)
 86c22f8c Ashwin Chaugule 2014-11-12  105  {
 86c22f8c Ashwin Chaugule 2014-11-12  106  struct device *dev = 
 pcc_mbox_ctrl.dev;
 86c22f8c Ashwin Chaugule 2014-11-12  107  struct mbox_chan *chan;
 86c22f8c Ashwin Chaugule 2014-11-12  108  unsigned long flags;
 86c22f8c Ashwin Chaugule 2014-11-12  109  
 86c22f8c Ashwin Chaugule 2014-11-12  110  /*
 86c22f8c Ashwin Chaugule 2014-11-12  111   * Each PCC Subspace is a 
 Mailbox Channel.
 86c22f8c Ashwin Chaugule 2014-11-12  112   * The PCC Clients get their 
 PCC Subspace ID
 86c22f8c Ashwin Chaugule 2014-11-12  113   * from their own tables and 
 pass it here.
 86c22f8c Ashwin Chaugule 2014-11-12  114   * This returns a pointer to 
 the PCC subspace
 86c22f8c Ashwin Chaugule 2014-11-12  115   * for the Client to operate on.
 86c22f8c Ashwin Chaugule 2014-11-12  116   */
 86c22f8c Ashwin Chaugule 2014-11-12  117  chan = 
 get_pcc_channel(subspace_id);
 86c22f8c Ashwin Chaugule 2014-11-12  118  
 86c22f8c Ashwin Chaugule 2014-11-12 @119  if (!chan || chan-cl) {
 86c22f8c Ashwin Chaugule 2014-11-12  120  dev_err(dev, %s: PCC 
 mailbox not free\n, __func__);
 86c22f8c Ashwin Chaugule 2014-11-12  121  return ERR_PTR(-EBUSY);
 86c22f8c Ashwin Chaugule 2014-11-12  122  }
 86c22f8c Ashwin Chaugule 2014-11-12  123  
 86c22f8c Ashwin Chaugule 2014-11-12  124  spin_lock_irqsave(chan-lock, 
 flags);
 86c22f8c Ashwin Chaugule 2014-11-12  125  chan-msg_free = 0;
 86c22f8c Ashwin Chaugule 2014-11-12  126  chan-msg_count = 0;
 86c22f8c Ashwin Chaugule 2014-11-12  127  chan-active_req = NULL;
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [mac80211-next:master 14/18] net/mac80211/mlme.c:4235 ieee80211_prep_connection() error: we previously assumed 'new_sta' could be null (see line 4232)

2014-12-17 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 
master
head:   59c9880de7bcb0be8660405040917bb47a8300fc
commit: 1b104407afcc67d9f430d505a7b5f7b11e6b2d59 [14/18] mac80211: Fix ignored 
HT override configurations

net/mac80211/mlme.c:4235 ieee80211_prep_connection() error: we previously 
assumed 'new_sta' could be null (see line 4232)

git remote add mac80211-next 
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git
git remote update mac80211-next
git checkout 1b104407afcc67d9f430d505a7b5f7b11e6b2d59
vim +/new_sta +4235 net/mac80211/mlme.c

1b104407 Chaya Rachel Ivgi 2014-12-14  4226 
ieee80211_apply_htcap_overrides(sdata, sta_ht_cap);
1b104407 Chaya Rachel Ivgi 2014-12-14  4227  
1b104407 Chaya Rachel Ivgi 2014-12-14  4228 is_override = (sta_ht_cap.cap  
IEEE80211_HT_CAP_SUP_WIDTH_20_40) !=
1b104407 Chaya Rachel Ivgi 2014-12-14  4229   
(sband-ht_cap.cap 
1b104407 Chaya Rachel Ivgi 2014-12-14  4230
IEEE80211_HT_CAP_SUP_WIDTH_20_40);
b17166a7 Johannes Berg 2012-07-27  4231  
1b104407 Chaya Rachel Ivgi 2014-12-14 @4232 if (new_sta || is_override) {
b17166a7 Johannes Berg 2012-07-27  4233 err = 
ieee80211_prep_channel(sdata, cbss);
b17166a7 Johannes Berg 2012-07-27  4234 if (err) {
b17166a7 Johannes Berg 2012-07-27 @4235 
sta_info_free(local, new_sta);
2103dec1 Simon Wunderlich  2013-07-08  4236 return -EINVAL;
b17166a7 Johannes Berg 2012-07-27  4237 }
1b104407 Chaya Rachel Ivgi 2014-12-14  4238 }

---
0-DAY kernel test infrastructureOpen Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [peterz-queue:perf/core 34/45] kernel/events/core.c:4365 perf_mmap_close() error: double unlock 'mutex:event-mmap_mutex'

2015-02-05 Thread Dan Carpenter
The locking check sucks.  I need to re-write it.

regards,
dan carpenter

On Tue, Feb 03, 2015 at 10:47:55PM +0800, kbuild test robot wrote:
 TO: Peter Zijlstra pet...@infradead.org
 CC: Alexander Shishkin alexander.shish...@linux.intel.com
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git 
 perf/core
 head:   7fe898837422b0205343b26d02f747a063a6ccfe
 commit: 324f99a6daa03968f9240cccb60bdea89917cd69 [34/45] perf: Add AUX area 
 to ring buffer for raw data streams
 :: branch date: 75 minutes ago
 :: commit date: 75 minutes ago
 
 kernel/events/core.c:4365 perf_mmap_close() error: double unlock 
 'mutex:event-mmap_mutex'
 
 git remote add peterz-queue 
 git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
 git remote update peterz-queue
 git checkout 324f99a6daa03968f9240cccb60bdea89917cd69
 vim +4365 kernel/events/core.c
 
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4349  */
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4350 if 
 (rb_has_aux(rb)  vma-vm_pgoff == rb-aux_pgoff 
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4351 
 atomic_dec_and_mutex_lock(rb-aux_mmap_count, event-mmap_mutex)) {
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4352 
 atomic_long_sub(rb-aux_nr_pages, mmap_user-locked_vm);
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4353 
 vma-vm_mm-pinned_vm -= rb-aux_mmap_locked;
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4354  
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4355 
 rb_free_aux(rb);
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4356 
 mutex_unlock(event-mmap_mutex);
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4357 }
 324f99a6 kernel/events/core.c Peter Zijlstra 2015-01-14  4358  
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4359 
 atomic_dec(rb-mmap_count);
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4360  
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4361 if 
 (!atomic_dec_and_mutex_lock(event-mmap_count, event-mmap_mutex))
 b69cf536 kernel/events/core.c Peter Zijlstra 2014-03-14  4362 
 goto out_put;
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4363  
 b69cf536 kernel/events/core.c Peter Zijlstra 2014-03-14  4364 
 ring_buffer_attach(event, NULL);
 cdd6c482 kernel/perf_event.c  Ingo Molnar2009-09-21 @4365 
 mutex_unlock(event-mmap_mutex);
 ac9721f3 kernel/perf_event.c  Peter Zijlstra 2010-05-27  4366  
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4367 /* If 
 there's still other mmap()s of this buffer, we're done. */
 b69cf536 kernel/events/core.c Peter Zijlstra 2014-03-14  4368 if 
 (atomic_read(rb-mmap_count))
 b69cf536 kernel/events/core.c Peter Zijlstra 2014-03-14  4369 
 goto out_put;
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4370  
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4371 /*
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4372  * No 
 other mmap()s, detach from all other events that might redirect
 9bb5d40c kernel/events/core.c Peter Zijlstra 2013-06-04  4373  * into 
 the now unreachable buffer. Somewhat complicated by the
 
 :: The code at line 4365 was first introduced by commit
 :: cdd6c482c9ff9c55475ee7392ec8f672eddb7be6 perf: Do the big rename: 
 Performance Counters - Performance Events
 
 :: TO: Ingo Molnar mi...@elte.hu
 :: CC: Ingo Molnar mi...@elte.hu
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [nfc-next:master 6/17] net/nfc/nci/hci.c:254 nci_hci_cmd_received() warn: assigning (-128) to unsigned variable 'status'

2015-02-05 Thread Dan Carpenter
The warning is correct-ish but the code is ok.

regards,
dan carpenter


On Wed, Feb 04, 2015 at 05:20:27PM +0800, kbuild test robot wrote:
 TO: Christophe Ricard christophe.ric...@gmail.com
 CC: Samuel Ortiz sa...@linux.intel.com
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git 
 master
 head:   fa00e8fed457841cb24219dbe3cfba7d56de6317
 commit: 11f54f228643d0248ec00ce8c9fb8d872f87e7b8 [6/17] NFC: nci: Add HCI 
 over NCI protocol support
 :: branch date: 65 minutes ago
 :: commit date: 2 days ago
 
 net/nfc/nci/hci.c:254 nci_hci_cmd_received() warn: assigning (-128) to 
 unsigned variable 'status'
 
 git remote add nfc-next 
 git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git
 git remote update nfc-next
 git checkout 11f54f228643d0248ec00ce8c9fb8d872f87e7b8
 vim +/status +254 net/nfc/nci/hci.c
 
 11f54f22 Christophe Ricard 2015-02-01  238  
 11f54f22 Christophe Ricard 2015-02-01  239return r;
 11f54f22 Christophe Ricard 2015-02-01  240  }
 11f54f22 Christophe Ricard 2015-02-01  241  EXPORT_SYMBOL(nci_hci_send_cmd);
 11f54f22 Christophe Ricard 2015-02-01  242  
 11f54f22 Christophe Ricard 2015-02-01  243  static void 
 nci_hci_event_received(struct nci_dev *ndev, u8 pipe,
 11f54f22 Christophe Ricard 2015-02-01  244   u8 
 event, struct sk_buff *skb)
 11f54f22 Christophe Ricard 2015-02-01  245  {
 11f54f22 Christophe Ricard 2015-02-01  246if 
 (ndev-ops-hci_event_received)
 11f54f22 Christophe Ricard 2015-02-01  247
 ndev-ops-hci_event_received(ndev, pipe, event, skb);
 11f54f22 Christophe Ricard 2015-02-01  248  }
 11f54f22 Christophe Ricard 2015-02-01  249  
 11f54f22 Christophe Ricard 2015-02-01  250  static void 
 nci_hci_cmd_received(struct nci_dev *ndev, u8 pipe,
 11f54f22 Christophe Ricard 2015-02-01  251 u8 
 cmd, struct sk_buff *skb)
 11f54f22 Christophe Ricard 2015-02-01  252  {
 11f54f22 Christophe Ricard 2015-02-01  253u8 gate = 
 ndev-hci_dev-pipes[pipe].gate;
 11f54f22 Christophe Ricard 2015-02-01 @254u8 status = NCI_HCI_ANY_OK | 
 ~NCI_HCI_FRAGMENT;
 11f54f22 Christophe Ricard 2015-02-01  255u8 dest_gate, new_pipe;
 11f54f22 Christophe Ricard 2015-02-01  256struct nci_hci_create_pipe_resp 
 *create_info;
 11f54f22 Christophe Ricard 2015-02-01  257struct nci_hci_delete_pipe_noti 
 *delete_info;
 11f54f22 Christophe Ricard 2015-02-01  258struct 
 nci_hci_all_pipe_cleared_noti *cleared_info;
 11f54f22 Christophe Ricard 2015-02-01  259  
 11f54f22 Christophe Ricard 2015-02-01  260pr_debug(from gate %x pipe %x 
 cmd %x\n, gate, pipe, cmd);
 11f54f22 Christophe Ricard 2015-02-01  261  
 11f54f22 Christophe Ricard 2015-02-01  262switch (cmd) {
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [target:for-next 19/19] drivers/vhost/scsi.c:2139 vhost_scsi_make_tpg() warn: impossible condition '(tpgt (~0)) = (0-u32max u32max)'

2015-02-05 Thread Dan Carpenter
I sent a fix for this because it is a memory corruption bug and I am
too selfish to share author credit on those.

regards,
dan carpenter

On Tue, Feb 03, 2015 at 03:20:25PM +0800, kbuild test robot wrote:
 TO: Nicholas Bellinger n...@linux-iscsi.org
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git 
 for-next
 head:   2440cd3b0d21c3163d8e473b35d207e16be04595
 commit: 2440cd3b0d21c3163d8e473b35d207e16be04595 [19/19] vhost/scsi: Global 
 tcm_vhost - vhost_scsi rename
 :: branch date: 47 minutes ago
 :: commit date: 47 minutes ago
 
 New smatch warnings:
 drivers/vhost/scsi.c:2139 vhost_scsi_make_tpg() warn: impossible condition 
 '(tpgt  (~0)) = (0-u32max  u32max)'
 
 Old smatch warnings:
 drivers/vhost/scsi.c:971 vhost_scsi_send_bad_target() warn: check that 
 'rsp.status' doesn't leak information
 
 git remote add target 
 git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git
 git remote update target
 git checkout 2440cd3b0d21c3163d8e473b35d207e16be04595
 vim +2139 drivers/vhost/scsi.c
 
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2123  };
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2124  
 683bd967 drivers/vhost/scsi.c  Asias He   2013-05-06  2125  
 static struct se_portal_group *
 2440cd3b drivers/vhost/scsi.c  Nicholas Bellinger 2015-01-31  2126  
 vhost_scsi_make_tpg(struct se_wwn *wwn,
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2127
struct config_group *group,
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2128
const char *name)
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2129  {
 2440cd3b drivers/vhost/scsi.c  Nicholas Bellinger 2015-01-31  2130
 struct vhost_scsi_tport *tport = container_of(wwn,
 2440cd3b drivers/vhost/scsi.c  Nicholas Bellinger 2015-01-31  2131
 struct vhost_scsi_tport, tport_wwn);
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2132  
 2440cd3b drivers/vhost/scsi.c  Nicholas Bellinger 2015-01-31  2133
 struct vhost_scsi_tpg *tpg;
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2134
 unsigned long tpgt;
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2135
 int ret;
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2136  
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2137
 if (strstr(name, tpgt_) != name)
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2138
 return ERR_PTR(-EINVAL);
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18 @2139
 if (kstrtoul(name + 5, 10, tpgt) || tpgt  UINT_MAX)
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2140
 return ERR_PTR(-EINVAL);
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2141  
 2440cd3b drivers/vhost/scsi.c  Nicholas Bellinger 2015-01-31  2142
 tpg = kzalloc(sizeof(struct vhost_scsi_tpg), GFP_KERNEL);
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2143
 if (!tpg) {
 2440cd3b drivers/vhost/scsi.c  Nicholas Bellinger 2015-01-31  2144
 pr_err(Unable to allocate struct vhost_scsi_tpg);
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2145
 return ERR_PTR(-ENOMEM);
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2146
 }
 057cbf49 drivers/vhost/tcm_vhost.c Nicholas Bellinger 2012-07-18  2147
 mutex_init(tpg-tv_tpg_mutex);
 
 :: The code at line 2139 was first introduced by commit
 :: 057cbf49a1f08297877e46c82f707b1bfea806a8 tcm_vhost: Initial merge for 
 vhost level target fabric driver
 
 :: TO: Nicholas Bellinger n...@linux-iscsi.org
 :: CC: Nicholas Bellinger n...@linux-iscsi.org
 
 ---
 0-DAY kernel test infrastructureOpen Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


<    1   2   3   4   5   6   7   8   9   10   >