[kbuild] [target:mfc_target 41/41] drivers/target/mlx4_fc/mfc_rfci.c:987:3-34: code aligned with following code on line 988

2013-11-28 Thread Dan Carpenter
Hi Vu,

FYI, there are coccinelle warnings in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git 
mfc_target
head:   b4867b474e8e243e4c9a92b0aeb63110792b27a9
commit: b4867b474e8e243e4c9a92b0aeb63110792b27a9 [41/41] mfc_target: WIP check 
initiator node acl with right mac

 drivers/target/mlx4_fc/mfc_rfci.c:987:3-34: code aligned with following code 
 on line 988

git remote add target 
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git
git remote update target
git checkout b4867b474e8e243e4c9a92b0aeb63110792b27a9
vim +987 drivers/target/mlx4_fc/mfc_rfci.c

adbbf0eb Nicholas Bellinger 2013-07-29  981 if (!rc)
adbbf0eb Nicholas Bellinger 2013-07-29  982 goto 
free_packet;
e1ac4848 Vu Pham2013-10-08  983 break;
e1ac4848 Vu Pham2013-10-08  984  
e1ac4848 Vu Pham2013-10-08  985 case FC_RCTL_ELS_REQ:
e1ac4848 Vu Pham2013-10-08  986 if 
(fc_frame_payload_op(fp) == ELS_PRLI)
b4867b47 Vu Pham2013-11-08 @987 rc = 
mfc_handle_prli(fp, vhba);
b4867b47 Vu Pham2013-11-08 @988 if (rc)
b4867b47 Vu Pham2013-11-08  989 goto 
free_packet;
e1ac4848 Vu Pham2013-10-08  990 break;
e1ac4848 Vu Pham2013-10-08  991  

---
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] [at91:at91-3.14-next_fixes_cleanup_dt-resolution 2454/2602] drivers/hwmon/it87.c:2034 it87_remove_files() error: buffer overflow 'it87_attributes_in_beep' 9 = 9

2013-12-03 Thread Dan Carpenter
Hi Rudolf,

FYI, there are new smatch warnings show up in

tree:   git://github.com/at91linux/linux-at91.git 
at91-3.14-next_fixes_cleanup_dt-resolution
head:   e4491207a614e4d9918f4812792c82705db82c4b
commit: 6f1a578cf200459198fca517e3f90a2a986d8538 [2454/2602] hwmon: (it87) Add 
support for the ITE IT8603E

drivers/hwmon/it87.c:2034 it87_remove_files() error: buffer overflow 
'it87_attributes_in_beep' 9 = 9
drivers/hwmon/it87.c:2036 it87_remove_files() error: buffer overflow 
'it87_attributes_in_beep' 9 = 9
drivers/hwmon/it87.c:2174 it87_probe() error: buffer overflow 
'it87_attributes_in_beep' 9 = 9
drivers/hwmon/it87.c:2176 it87_probe() error: buffer overflow 
'it87_attributes_in_beep' 9 = 9

git remote add at91 git://github.com/at91linux/linux-at91.git
git remote update at91
git checkout 6f1a578cf200459198fca517e3f90a2a986d8538
vim +/it87_attributes_in_beep +2034 drivers/hwmon/it87.c

723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2028  
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2029   
sysfs_remove_group(dev-kobj, it87_group);
6f1a578c drivers/hwmon/it87.c Rudolf Marek   2013-12-02  2030   for (i 
= 0; i  10; i++) {
9172b5d1 drivers/hwmon/it87.c Guenter Roeck  2012-03-24  2031   
if (sio_data-skip_in  (1  i))
9172b5d1 drivers/hwmon/it87.c Guenter Roeck  2012-03-24  2032   
continue;
9172b5d1 drivers/hwmon/it87.c Guenter Roeck  2012-03-24  2033   
sysfs_remove_group(dev-kobj, it87_group_in[i]);
9172b5d1 drivers/hwmon/it87.c Guenter Roeck  2012-03-24 @2034   
if (it87_attributes_in_beep[i])
9172b5d1 drivers/hwmon/it87.c Guenter Roeck  2012-03-24  2035   
sysfs_remove_file(dev-kobj,
9172b5d1 drivers/hwmon/it87.c Guenter Roeck  2012-03-24 @2036   
  it87_attributes_in_beep[i]);
9172b5d1 drivers/hwmon/it87.c Guenter Roeck  2012-03-24  2037   }
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2038   for (i 
= 0; i  3; i++) {
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2039   
if (!(data-has_temp  (1  i)))
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2040   
continue;
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2041   
sysfs_remove_group(dev-kobj, it87_group_temp[i]);
161d898a drivers/hwmon/it87.c Guenter Roeck  2012-12-19  2042   
if (has_temp_offset(data))
161d898a drivers/hwmon/it87.c Guenter Roeck  2012-12-19  2043   
sysfs_remove_file(dev-kobj,
161d898a drivers/hwmon/it87.c Guenter Roeck  2012-12-19  2044   
  it87_attributes_temp_offset[i]);
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2045   
if (sio_data-beep_pin)
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2046   
sysfs_remove_file(dev-kobj,
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2047   
  it87_attributes_temp_beep[i]);
4573acbc drivers/hwmon/it87.c Guenter Roeck  2012-03-26  2048   }
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2049   for (i 
= 0; i  5; i++) {
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2050   
if (!(data-has_fan  (1  i)))
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2051   
continue;
e1169ba0 drivers/hwmon/it87.c Guenter Roeck  2012-12-19  2052   
sysfs_remove_group(dev-kobj, it87_group_fan[i]);
d9b327c3 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2053   
if (sio_data-beep_pin)
d9b327c3 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2054   
sysfs_remove_file(dev-kobj,
d9b327c3 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2055   
  it87_attributes_fan_beep[i]);
e1169ba0 drivers/hwmon/it87.c Guenter Roeck  2012-12-19  2056   
if (i  3  !has_16bit_fans(data))
e1169ba0 drivers/hwmon/it87.c Guenter Roeck  2012-12-19  2057   
sysfs_remove_file(dev-kobj,
e1169ba0 drivers/hwmon/it87.c Guenter Roeck  2012-12-19  2058   
  it87_attributes_fan_div[i]);
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2059   }
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2060   for (i 
= 0; i  3; i++) {
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2061   
if (sio_data-skip_pwm  (1  0))
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2062   
continue;
723a0aa0 drivers/hwmon/it87.c Jean Delvare   2010-03-05  2063   
sysfs_remove_group(dev-kobj, it87_group_pwm[i]);
4f3f51bc drivers/hwmon/it87.c Jean Delvare   2010-03-05  2064   
if (has_old_autopwm(data))
4f3f51bc 

[kbuild] [danvet-drm:drm-init-cleanup 23/49] drivers/gpu/drm/r128/r128_state.c:1014:10-17: WARNING opportunity for memdup_user

2013-12-05 Thread Dan Carpenter

Hi Daniel,

FYI, there are coccinelle warnings in

tree:   git://people.freedesktop.org/~danvet/drm drm-init-cleanup
head:   56abb939d445314fe0148f82f11ea60b5e293056
commit: c994fc0afdfd18e84e287ad3f70e7ecc0b518e74 [23/49] drm: Kill 
DRM_COPY_(TO|FROM)_USER

 drivers/gpu/drm/r128/r128_state.c:1014:10-17: WARNING opportunity for 
 memdup_user
 drivers/gpu/drm/r128/r128_state.c:1029:9-16: WARNING opportunity for 
 memdup_user
 drivers/gpu/drm/r128/r128_state.c:904:10-17: WARNING opportunity for 
 memdup_user
 drivers/gpu/drm/r128/r128_state.c:914:9-16: WARNING opportunity for 
 memdup_user
--
 drivers/gpu/drm/savage/savage_state.c:1004:13-20: WARNING opportunity for 
 memdup_user

Please consider folding the attached diff :-)

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
From: Dan Carpenter dan.carpen...@oracle.com
Subject: [PATCH] drm: use memdup_user() as a cleanup
TO: Daniel Vetter daniel.vet...@ffwll.ch
CC: Daniel Vetter daniel.vet...@ffwll.ch
CC: linux-ker...@vger.kernel.org 

drivers/gpu/drm/r128/r128_state.c:1014:10-17: WARNING opportunity for memdup_user
/c/kernel-tests/src/cocci/drivers/gpu/drm/r128/r128_state.c:1029:9-16: WARNING opportunity for memdup_user
/c/kernel-tests/src/cocci/drivers/gpu/drm/r128/r128_state.c:904:10-17: WARNING opportunity for memdup_user
/c/kernel-tests/src/cocci/drivers/gpu/drm/r128/r128_state.c:914:9-16: WARNING opportunity for memdup_user

 Use memdup_user rather than duplicating its implementation
 This is a little bit restricted to reduce false positives

Generated by: coccinelle/api/memdup_user.cocci

CC: Daniel Vetter daniel.vet...@ffwll.ch
Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
---

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

 cocci-output-8730-4c0e39-r128_state.c |   46 --
 1 file changed, 12 insertions(+), 34 deletions(-)

--- a/drivers/gpu/drm/r128/r128_state.c
+++ b/drivers/gpu/drm/r128/r128_state.c
@@ -901,25 +901,16 @@ static int r128_cce_dispatch_write_span(
 		return -EFAULT;
 
 	buffer_size = depth-n * sizeof(u32);
-	buffer = kmalloc(buffer_size, GFP_KERNEL);
-	if (buffer == NULL)
-		return -ENOMEM;
-	if (copy_from_user(buffer, depth-buffer, buffer_size)) {
-		kfree(buffer);
-		return -EFAULT;
-	}
+	buffer = memdup_user(depth-buffer, buffer_size);
+	if (IS_ERR(buffer))
+		return PTR_ERR(buffer);
 
 	mask_size = depth-n * sizeof(u8);
 	if (depth-mask) {
-		mask = kmalloc(mask_size, GFP_KERNEL);
-		if (mask == NULL) {
+		mask = memdup_user(depth-mask, mask_size);
+		if (IS_ERR(mask)) {
 			kfree(buffer);
-			return -ENOMEM;
-		}
-		if (copy_from_user(mask, depth-mask, mask_size)) {
-			kfree(buffer);
-			kfree(mask);
-			return -EFAULT;
+			return PTR_ERR(mask);
 		}
 
 		for (i = 0; i  count; i++, x++) {
@@ -1011,34 +1002,21 @@ static int r128_cce_dispatch_write_pixel
 	}
 
 	buffer_size = depth-n * sizeof(u32);
-	buffer = kmalloc(buffer_size, GFP_KERNEL);
-	if (buffer == NULL) {
-		kfree(x);
-		kfree(y);
-		return -ENOMEM;
-	}
-	if (copy_from_user(buffer, depth-buffer, buffer_size)) {
+	buffer = memdup_user(depth-buffer, buffer_size);
+	if (IS_ERR(buffer)) {
 		kfree(x);
 		kfree(y);
-		kfree(buffer);
-		return -EFAULT;
+		return PTR_ERR(buffer);
 	}
 
 	if (depth-mask) {
 		mask_size = depth-n * sizeof(u8);
-		mask = kmalloc(mask_size, GFP_KERNEL);
-		if (mask == NULL) {
-			kfree(x);
-			kfree(y);
-			kfree(buffer);
-			return -ENOMEM;
-		}
-		if (copy_from_user(mask, depth-mask, mask_size)) {
+		mask = memdup_user(depth-mask, mask_size);
+		if (IS_ERR(mask)) {
 			kfree(x);
 			kfree(y);
 			kfree(buffer);
-			kfree(mask);
-			return -EFAULT;
+			return PTR_ERR(mask);
 		}
 
 		for (i = 0; i  count; i++) {
___
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] [cryptodev:master 16/25] drivers/crypto/ccp/ccp-crypto-aes-xts.c:147 ccp_aes_xts_crypt() error: buffer overflow 'unit_size_map' 10 = 10

2013-12-09 Thread Dan Carpenter
False positive because the last irteration through the loop always
breaks.

This functions seems to have a lot of user trigerable pr_err() calls
though, so that sucks.

regards,
dan carpenter

On Mon, Dec 09, 2013 at 09:50:39PM +0800, Fengguang Wu wrote:
 TO: Tom Lendacky thomas.lenda...@amd.com
 CC: Herbert Xu herb...@gondor.apana.org.au
 
 
 Hi Tom,
 
 FYI, there are new smatch warnings show up in
 
 tree:   
 git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
 head:   e37b94ebffdd93d121e5308eb93e2e55a0893fbb
 commit: f114766088f352a47f57307ff927b815e0239644 [16/25] crytpo: ccp - CCP 
 device driver build files
 :: branch date: 2 hours ago
 :: commit date: 4 days ago
 
 drivers/crypto/ccp/ccp-crypto-aes-xts.c:147 ccp_aes_xts_crypt() error: buffer 
 overflow 'unit_size_map' 10 = 10
 drivers/crypto/ccp/ccp-crypto-aes-xts.c:168 ccp_aes_xts_crypt() error: buffer 
 overflow 'unit_size_map' 10 = 10
 
 git remote add cryptodev 
 git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
 git remote update cryptodev
 git checkout f114766088f352a47f57307ff927b815e0239644
 vim +/unit_size_map +147 drivers/crypto/ccp/ccp-crypto-aes-xts.c
 
 1d6b8a6f Tom Lendacky 2013-11-12  141 }
 1d6b8a6f Tom Lendacky 2013-11-12  142  
 1d6b8a6f Tom Lendacky 2013-11-12  143 for (unit = 0; unit  
 ARRAY_SIZE(unit_size_map); unit++)
 1d6b8a6f Tom Lendacky 2013-11-12  144 if (!(req-nbytes  
 (unit_size_map[unit].size - 1)))
 1d6b8a6f Tom Lendacky 2013-11-12  145 break;
 1d6b8a6f Tom Lendacky 2013-11-12  146  
 1d6b8a6f Tom Lendacky 2013-11-12 @147 if ((unit_size_map[unit].value 
 == CCP_XTS_AES_UNIT_SIZE__LAST) ||
 1d6b8a6f Tom Lendacky 2013-11-12  148 (ctx-u.aes.key_len != 
 AES_KEYSIZE_128)) {
 1d6b8a6f Tom Lendacky 2013-11-12  149 /* Use the fallback to 
 process the request for any
 1d6b8a6f Tom Lendacky 2013-11-12  150  * unsupported unit 
 sizes or key sizes
 1d6b8a6f Tom Lendacky 2013-11-12  151  */
 1d6b8a6f Tom Lendacky 2013-11-12  152 
 ablkcipher_request_set_tfm(req, ctx-u.aes.tfm_ablkcipher);
 1d6b8a6f Tom Lendacky 2013-11-12  153 ret = (encrypt) ? 
 crypto_ablkcipher_encrypt(req) :
 1d6b8a6f Tom Lendacky 2013-11-12  154   
 crypto_ablkcipher_decrypt(req);
 1d6b8a6f Tom Lendacky 2013-11-12  155 
 ablkcipher_request_set_tfm(req, __crypto_ablkcipher_cast(tfm));
 1d6b8a6f Tom Lendacky 2013-11-12  156  
 1d6b8a6f Tom Lendacky 2013-11-12  157 return ret;
 1d6b8a6f Tom Lendacky 2013-11-12  158 }
 1d6b8a6f Tom Lendacky 2013-11-12  159  
 1d6b8a6f Tom Lendacky 2013-11-12  160 memcpy(rctx-iv, req-info, 
 AES_BLOCK_SIZE);
 1d6b8a6f Tom Lendacky 2013-11-12  161 sg_init_one(rctx-iv_sg, 
 rctx-iv, AES_BLOCK_SIZE);
 1d6b8a6f Tom Lendacky 2013-11-12  162  
 1d6b8a6f Tom Lendacky 2013-11-12  163 memset(rctx-cmd, 0, 
 sizeof(rctx-cmd));
 1d6b8a6f Tom Lendacky 2013-11-12  164 
 INIT_LIST_HEAD(rctx-cmd.entry);
 1d6b8a6f Tom Lendacky 2013-11-12  165 rctx-cmd.engine = 
 CCP_ENGINE_XTS_AES_128;
 1d6b8a6f Tom Lendacky 2013-11-12  166 rctx-cmd.u.xts.action = 
 (encrypt) ? CCP_AES_ACTION_ENCRYPT
 1d6b8a6f Tom Lendacky 2013-11-12  167 
: CCP_AES_ACTION_DECRYPT;
 1d6b8a6f Tom Lendacky 2013-11-12 @168 rctx-cmd.u.xts.unit_size = 
 unit_size_map[unit].value;
 1d6b8a6f Tom Lendacky 2013-11-12  169 rctx-cmd.u.xts.key = 
 ctx-u.aes.key_sg;
 1d6b8a6f Tom Lendacky 2013-11-12  170 rctx-cmd.u.xts.key_len = 
 ctx-u.aes.key_len;
 1d6b8a6f Tom Lendacky 2013-11-12  171 rctx-cmd.u.xts.iv = 
 rctx-iv_sg;
 
 :: The code at line 147 was first introduced by commit
 :: 1d6b8a6f64076aee9e63474c0778a50f95c054ee crypto: ccp - CCP XTS-AES 
 crypto API support
 
 :: TO: Tom Lendacky thomas.lenda...@amd.com
 :: CC: Herbert Xu herb...@gondor.apana.org.au
 
 ---
 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 5/6] net/bluetooth/6lowpan.c:334 bt_6lowpan_recv() error: we previously assumed 'dev' could be null (see line 331)

2013-12-11 Thread Dan Carpenter
Hi Jukka,

FYI, there are new smatch warnings show up in

tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git 
master
head:   89863109e3dd562529ffd8a559b0de068d1d8502
commit: 18722c247023035b9e2e2a08a887adec2a9a6e49 [5/6] Bluetooth: Enable 
6LoWPAN support for BT LE devices

net/bluetooth/6lowpan.c:334 bt_6lowpan_recv() error: we previously assumed 
'dev' could be null (see line 331)

git remote add bluetooth 
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
git remote update bluetooth
git checkout 18722c247023035b9e2e2a08a887adec2a9a6e49
vim +/dev +334 net/bluetooth/6lowpan.c

18722c24 Jukka Rissanen 2013-12-11  325  
18722c24 Jukka Rissanen 2013-12-11  326 peer = lookup_peer(conn);
18722c24 Jukka Rissanen 2013-12-11  327 if (!peer)
18722c24 Jukka Rissanen 2013-12-11  328 return -ENOENT;
18722c24 Jukka Rissanen 2013-12-11  329  
18722c24 Jukka Rissanen 2013-12-11  330 dev = lookup_dev(conn);
18722c24 Jukka Rissanen 2013-12-11 @331 if (dev  !dev-netdev)

The condition should be:
if (!dev || !dev-netdev)

18722c24 Jukka Rissanen 2013-12-11  332 return -ENOENT;
18722c24 Jukka Rissanen 2013-12-11  333  
18722c24 Jukka Rissanen 2013-12-11 @334 err = recv_pkt(skb, 
dev-netdev, conn);
18722c24 Jukka Rissanen 2013-12-11  335 BT_DBG(recv pkt %d, err);
18722c24 Jukka Rissanen 2013-12-11  336  
18722c24 Jukka Rissanen 2013-12-11  337 return err;

---
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] [congwang:tc-action 498/499] include/net/act_api.h:55 tcf_hashinfo_init() warn: returning -1 instead of -ENOMEM is sloppy

2013-12-12 Thread Dan Carpenter
Hi Cong,

FYI, there are new smatch warnings show up in

tree:   git://github.com/congwang/linux.git tc-action
head:   32d1a012f22a3ab30382596c2344b11bd60ffe83
commit: d3d8a84365849b8d0e9be0f717229027fcedfe48 [498/499] sched: init struct 
tcf_hashinfo at register time

include/net/act_api.h:55 tcf_hashinfo_init() warn: returning -1 instead of 
-ENOMEM is sloppy

git remote add congwang git://github.com/congwang/linux.git
git remote update congwang
git checkout d3d8a84365849b8d0e9be0f717229027fcedfe48
vim +55 include/net/act_api.h

e9ce1cd3 David S. Miller 2006-08-21  39 struct tcf_common   **htab;
e9ce1cd3 David S. Miller 2006-08-21  40 unsigned inthmask;
d3d8a843 Cong Wang   2013-12-11  41 rwlock_tlock;
e9ce1cd3 David S. Miller 2006-08-21  42  };
e9ce1cd3 David S. Miller 2006-08-21  43  
e9ce1cd3 David S. Miller 2006-08-21  44  static inline unsigned int 
tcf_hash(u32 index, unsigned int hmask)
e9ce1cd3 David S. Miller 2006-08-21  45  {
e9ce1cd3 David S. Miller 2006-08-21  46 return index  hmask;
e9ce1cd3 David S. Miller 2006-08-21  47  }
^1da177e Linus Torvalds  2005-04-16  48  
d3d8a843 Cong Wang   2013-12-11  49  static inline int 
tcf_hashinfo_init(struct tcf_hashinfo *hf, unsigned int mask)
d3d8a843 Cong Wang   2013-12-11  50  {
d3d8a843 Cong Wang   2013-12-11  51 rwlock_init(hf-lock);
d3d8a843 Cong Wang   2013-12-11  52 hf-hmask = mask;
d3d8a843 Cong Wang   2013-12-11  53 if (!(hf-htab = kzalloc((mask 
+ 1) * sizeof(struct tcf_common *),
d3d8a843 Cong Wang   2013-12-11  54  
GFP_KERNEL)))

Also checkpatch complains about these assignments in an if statement.

d3d8a843 Cong Wang   2013-12-11 @55 return -1;
d3d8a843 Cong Wang   2013-12-11  56 return 0;
d3d8a843 Cong Wang   2013-12-11  57  }
d3d8a843 Cong Wang   2013-12-11  58  
d3d8a843 Cong Wang   2013-12-11  59  static inline void 
tcf_hashinfo_destroy(struct tcf_hashinfo *hf)
d3d8a843 Cong Wang   2013-12-11  60  {
d3d8a843 Cong Wang   2013-12-11  61 kfree(hf-htab);
d3d8a843 Cong Wang   2013-12-11  62  }
d3d8a843 Cong Wang   2013-12-11  63  

---
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 1145/1155] drivers/net/usb/r8152.c:2711 rtl_ops_init() warn: assigning (-14) to unsigned variable 'ret'

2014-01-01 Thread Dan Carpenter
Hi hayeswang,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   8e769788b31438ceb245960a72bec8ed51eb04b2
commit: 43779f8dfb0051b2ecd5f17ea7ad089443278e82 [1145/1155] r8152: support 
RTL8153

drivers/net/usb/r8152.c:2711 rtl_ops_init() warn: assigning (-14) to unsigned 
variable 'ret'

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 43779f8dfb0051b2ecd5f17ea7ad089443278e82
vim +/ret +2711 drivers/net/usb/r8152.c

c81229c9 hayeswang 2014-01-02  2695 switch (id-idProduct) {
c81229c9 hayeswang 2014-01-02  2696 case PRODUCT_ID_RTL8152:
c81229c9 hayeswang 2014-01-02  2697 ops-init   
= r8152b_init;
c81229c9 hayeswang 2014-01-02  2698 ops-enable 
= rtl8152_enable;
c81229c9 hayeswang 2014-01-02  2699 ops-disable
= rtl8152_disable;
c81229c9 hayeswang 2014-01-02  2700 ops-down   
= rtl8152_down;
c81229c9 hayeswang 2014-01-02  2701 ops-unload 
= rtl8152_unload;
c81229c9 hayeswang 2014-01-02  2702 break;
43779f8d hayeswang 2014-01-02  2703 case PRODUCT_ID_RTL8153:
43779f8d hayeswang 2014-01-02  2704 ops-init   
= r8153_init;
43779f8d hayeswang 2014-01-02  2705 ops-enable 
= rtl8153_enable;
43779f8d hayeswang 2014-01-02  2706 ops-disable
= rtl8152_disable;
43779f8d hayeswang 2014-01-02  2707 ops-down   
= rtl8153_down;
43779f8d hayeswang 2014-01-02  2708 ops-unload 
= rtl8153_unload;
43779f8d hayeswang 2014-01-02  2709 break;
43779f8d hayeswang 2014-01-02  2710 default:
43779f8d hayeswang 2014-01-02 @2711 ret = -EFAULT;
43779f8d hayeswang 2014-01-02  2712 break;
43779f8d hayeswang 2014-01-02  2713 }
43779f8d hayeswang 2014-01-02  2714 break;
43779f8d hayeswang 2014-01-02  2715  
43779f8d hayeswang 2014-01-02  2716 case VENDOR_ID_SAMSUNG:
43779f8d hayeswang 2014-01-02  2717 switch (id-idProduct) {
43779f8d hayeswang 2014-01-02  2718 case PRODUCT_ID_SAMSUNG:
43779f8d hayeswang 2014-01-02  2719 ops-init   
= r8153_init;

---
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] [mmc:mmc-next 35/36] drivers/mmc/host/sh_mmcif.c:824 sh_mmcif_set_cmd() error: we previously assumed 'data' could be null (see line 789)

2014-01-07 Thread Dan Carpenter
Hi Laurent,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git mmc-next
head:   259245a845a173124bfe768fa1a2ac88e034b5b8
commit: 0111fc4646a6e84a432dda3e6398a8a69319e617 [35/36] mmc: sh_mmcif: Enable 
driver compilation with COMPILE_TEST

drivers/mmc/host/sh_mmcif.c:824 sh_mmcif_set_cmd() error: we previously assumed 
'data' could be null (see line 789)
drivers/mmc/host/sh_mmcif.c:1124 sh_mmcif_end_cmd() error: we previously 
assumed 'host-chan_rx' could be null (see line 1107)
drivers/mmc/host/sh_mmcif.c:1128 sh_mmcif_end_cmd() error: we previously 
assumed 'host-chan_tx' could be null (see line 1110)

git remote add mmc git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
git remote update mmc
git checkout 0111fc4646a6e84a432dda3e6398a8a69319e617
vim +/data +824 drivers/mmc/host/sh_mmcif.c

fdc50a94 Yusuke Goda   2010-05-26  783  case MMC_CLR_WRITE_PROT:
fdc50a94 Yusuke Goda   2010-05-26  784  case MMC_ERASE:
fdc50a94 Yusuke Goda   2010-05-26  785  tmp |= 
CMD_SET_RBSY;
fdc50a94 Yusuke Goda   2010-05-26  786  break;
fdc50a94 Yusuke Goda   2010-05-26  787  }
fdc50a94 Yusuke Goda   2010-05-26  788  /* WDAT / DATW */
69983404 Guennadi Liakhovetski 2011-12-26 @789  if (data) {
fdc50a94 Yusuke Goda   2010-05-26  790  tmp |= 
CMD_SET_WDAT;
fdc50a94 Yusuke Goda   2010-05-26  791  switch 
(host-bus_width) {
fdc50a94 Yusuke Goda   2010-05-26  792  case 
MMC_BUS_WIDTH_1:
fdc50a94 Yusuke Goda   2010-05-26  793  tmp |= 
CMD_SET_DATW_1;
fdc50a94 Yusuke Goda   2010-05-26  794  break;
fdc50a94 Yusuke Goda   2010-05-26  795  case 
MMC_BUS_WIDTH_4:
fdc50a94 Yusuke Goda   2010-05-26  796  tmp |= 
CMD_SET_DATW_4;
fdc50a94 Yusuke Goda   2010-05-26  797  break;
fdc50a94 Yusuke Goda   2010-05-26  798  case 
MMC_BUS_WIDTH_8:
fdc50a94 Yusuke Goda   2010-05-26  799  tmp |= 
CMD_SET_DATW_8;
fdc50a94 Yusuke Goda   2010-05-26  800  break;
fdc50a94 Yusuke Goda   2010-05-26  801  default:
e47bf32a Guennadi Liakhovetski 2010-11-24  802  
dev_err(host-pd-dev, Unsupported bus width.\n);
fdc50a94 Yusuke Goda   2010-05-26  803  break;
fdc50a94 Yusuke Goda   2010-05-26  804  }
555061f9 Teppei Kamijou2012-12-12  805  switch 
(host-timing) {
555061f9 Teppei Kamijou2012-12-12  806  case 
MMC_TIMING_UHS_DDR50:
555061f9 Teppei Kamijou2012-12-12  807  /*
555061f9 Teppei Kamijou2012-12-12  808   * MMC 
core will only set this timing, if the host
555061f9 Teppei Kamijou2012-12-12  809   * 
advertises the MMC_CAP_UHS_DDR50 capability. MMCIF
555061f9 Teppei Kamijou2012-12-12  810   * 
implementations with this capability, e.g. sh73a0,
555061f9 Teppei Kamijou2012-12-12  811   * will 
have to set it in their platform data.
555061f9 Teppei Kamijou2012-12-12  812   */
555061f9 Teppei Kamijou2012-12-12  813  tmp |= 
CMD_SET_DARS;
555061f9 Teppei Kamijou2012-12-12  814  break;
555061f9 Teppei Kamijou2012-12-12  815  }
fdc50a94 Yusuke Goda   2010-05-26  816  }
fdc50a94 Yusuke Goda   2010-05-26  817  /* DWEN */
fdc50a94 Yusuke Goda   2010-05-26  818  if (opc == 
MMC_WRITE_BLOCK || opc == MMC_WRITE_MULTIPLE_BLOCK)
fdc50a94 Yusuke Goda   2010-05-26  819  tmp |= 
CMD_SET_DWEN;
fdc50a94 Yusuke Goda   2010-05-26  820  /* CMLTE/CMD12EN */
fdc50a94 Yusuke Goda   2010-05-26  821  if (opc == 
MMC_READ_MULTIPLE_BLOCK || opc == MMC_WRITE_MULTIPLE_BLOCK) {
fdc50a94 Yusuke Goda   2010-05-26  822  tmp |= 
CMD_SET_CMLTE | CMD_SET_CMD12EN;
fdc50a94 Yusuke Goda   2010-05-26  823  
sh_mmcif_bitset(host, MMCIF_CE_BLOCK_SET,
69983404 Guennadi Liakhovetski 2011-12-26 @824  
data-blocks  16);
fdc50a94 Yusuke Goda   2010-05-26  825  }
fdc50a94 Yusuke Goda   2010-05-26  826  /* RIDXC[1:0] check 
bits */
fdc50a94 Yusuke Goda   2010-05-26  827  if (opc == 
MMC_SEND_OP_COND || opc == MMC_ALL_SEND_CID ||

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild   

[kbuild] [wireless-next:master 156/160] drivers/net/wireless/ath/ath9k/debug_sta.c:135 ath_debug_rate_stats() error: buffer overflow 'rstats-ht_stats' 24 = 24

2014-01-13 Thread Dan Carpenter
Hi Sujith,

FYI, there are new smatch warnings show up in

tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   608cfbe4abaf76e9d732efd7ed1cfa3998163d91
commit: 350e2dcb4647d144000db1505c94d586fcd57919 [156/160] ath9k: Add a debugfs 
file node_recv

drivers/net/wireless/ath/ath9k/debug_sta.c:135 ath_debug_rate_stats() error: 
buffer overflow 'rstats-ht_stats' 24 = 24
drivers/net/wireless/ath/ath9k/debug_sta.c:137 ath_debug_rate_stats() error: 
buffer overflow 'rstats-ht_stats' 24 = 24
drivers/net/wireless/ath/ath9k/debug_sta.c:140 ath_debug_rate_stats() error: 
buffer overflow 'rstats-ht_stats' 24 = 24
drivers/net/wireless/ath/ath9k/debug_sta.c:142 ath_debug_rate_stats() error: 
buffer overflow 'rstats-ht_stats' 24 = 24

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 350e2dcb4647d144000db1505c94d586fcd57919
vim +135 drivers/net/wireless/ath/ath9k/debug_sta.c

350e2dcb Sujith Manoharan 2014-01-13  129  
350e2dcb Sujith Manoharan 2014-01-13  130   if (IS_HT_RATE(rs-rs_rate)) {
350e2dcb Sujith Manoharan 2014-01-13  131   if (rxs-rate_idx  
ARRAY_SIZE(rstats-ht_stats))
350e2dcb Sujith Manoharan 2014-01-13  132   goto exit;
350e2dcb Sujith Manoharan 2014-01-13  133  
350e2dcb Sujith Manoharan 2014-01-13  134   if (rxs-flag  
RX_FLAG_40MHZ)
350e2dcb Sujith Manoharan 2014-01-13 @135   
rstats-ht_stats[rxs-rate_idx].ht40_cnt++;
350e2dcb Sujith Manoharan 2014-01-13  136   else
350e2dcb Sujith Manoharan 2014-01-13 @137   
rstats-ht_stats[rxs-rate_idx].ht20_cnt++;
350e2dcb Sujith Manoharan 2014-01-13  138  
350e2dcb Sujith Manoharan 2014-01-13  139   if (rxs-flag  
RX_FLAG_SHORT_GI)
350e2dcb Sujith Manoharan 2014-01-13 @140   
rstats-ht_stats[rxs-rate_idx].sgi_cnt++;
350e2dcb Sujith Manoharan 2014-01-13  141   else
350e2dcb Sujith Manoharan 2014-01-13 @142   
rstats-ht_stats[rxs-rate_idx].lgi_cnt++;
350e2dcb Sujith Manoharan 2014-01-13  143  
350e2dcb Sujith Manoharan 2014-01-13  144   goto exit;
350e2dcb Sujith Manoharan 2014-01-13  145   }

---
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] [f2fs:linux-3.4 83/89] fs/f2fs/checkpoint.c:311:28: sparse: Variable length array is used.

2014-01-20 Thread Dan Carpenter
On Mon, Jan 20, 2014 at 10:01:37AM +0800, Gu Zheng wrote:
 Hi Dan,
 Variable length array(vla) is allowed in ISO C99, and as an extension GCC
 accepts it in C89 mode.
 http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Variable-Length.html
 On my box, gcc does not give any warning to this, and it works very well.
 So I can not understand why Sparse gave this warning. Or this usage(vla)
 is forbidden in kernel source? If it is true, we must fix it. But, AFAIK,
 there are not these strict provisions.
 

The kernel has a 2 PAGE_SIZE stack so we need to make sure that
orphan_blocks is very small.  If any individual function uses over 1K
stack then it's considered a bug unless the call tree is carefully
audited.  The stack size limit has security implications so
orphan_blocks has to be something which is easy to audit.

regards,
dan carpenter


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


[kbuild] [ath6kl:ath-next-test 7/9] drivers/net/wireless/ath/ath10k/mac.c:2745:5-11: preceding lock on line 2663

2014-01-24 Thread Dan Carpenter
Hi Michal,

FYI, there are coccinelle warnings in

tree:   git://github.com/kvalo/ath ath-next-test
head:   748afc4735361e21ad655c0dc021ea3aaeeb3efd
commit: c930f744bdb0774ccf7c00e23637f54b8e71f0b6 [7/9] ath10k: implement 
channel switching

 drivers/net/wireless/ath/ath10k/mac.c:2745:5-11: preceding lock on line 2663

git remote add ath6kl git://github.com/kvalo/ath
git remote update ath6kl
git checkout c930f744bdb0774ccf7c00e23637f54b8e71f0b6
vim +2745 drivers/net/wireless/ath/ath10k/mac.c

5e3dd157 Kalle Valo2013-06-12  2657  {
5e3dd157 Kalle Valo2013-06-12  2658 struct ath10k *ar = hw-priv;
5e3dd157 Kalle Valo2013-06-12  2659 struct ath10k_vif *arvif = 
ath10k_vif_to_arvif(vif);
5e3dd157 Kalle Valo2013-06-12  2660 int ret = 0;
226a339b Bartosz Markowski 2013-09-26  2661 u32 vdev_param, pdev_param;
5e3dd157 Kalle Valo2013-06-12  2662  
5e3dd157 Kalle Valo2013-06-12 @2663 mutex_lock(ar-conf_mutex);
5e3dd157 Kalle Valo2013-06-12  2664  
5e3dd157 Kalle Valo2013-06-12  2665 if (changed  BSS_CHANGED_IBSS)
5e3dd157 Kalle Valo2013-06-12  2666 
ath10k_control_ibss(arvif, info, vif-addr);
5e3dd157 Kalle Valo2013-06-12  2667  
5e3dd157 Kalle Valo2013-06-12  2668 if (changed  
BSS_CHANGED_BEACON_INT) {
5e3dd157 Kalle Valo2013-06-12  2669 arvif-beacon_interval 
= info-beacon_int;
6d1506e7 Bartosz Markowski 2013-09-26  2670 vdev_param = 
ar-wmi.vdev_param-beacon_interval;
6d1506e7 Bartosz Markowski 2013-09-26  2671 ret = 
ath10k_wmi_vdev_set_param(ar, arvif-vdev_id, vdev_param,
5e3dd157 Kalle Valo2013-06-12  2672 
arvif-beacon_interval);
60c3daa8 Kalle Valo2013-09-08  2673 
ath10k_dbg(ATH10K_DBG_MAC,
60c3daa8 Kalle Valo2013-09-08  2674mac vdev %d 
beacon_interval %d\n,
60c3daa8 Kalle Valo2013-09-08  2675
arvif-vdev_id, arvif-beacon_interval);
60c3daa8 Kalle Valo2013-09-08  2676  
5e3dd157 Kalle Valo2013-06-12  2677 if (ret)
5e3dd157 Kalle Valo2013-06-12  2678 
ath10k_warn(Failed to set beacon interval for VDEV: %d\n,
5e3dd157 Kalle Valo2013-06-12  2679 
arvif-vdev_id);
5e3dd157 Kalle Valo2013-06-12  2680 }
5e3dd157 Kalle Valo2013-06-12  2681  
5e3dd157 Kalle Valo2013-06-12  2682 if (changed  
BSS_CHANGED_BEACON) {
60c3daa8 Kalle Valo2013-09-08  2683 
ath10k_dbg(ATH10K_DBG_MAC,
60c3daa8 Kalle Valo2013-09-08  2684vdev %d set 
beacon tx mode to staggered\n,
60c3daa8 Kalle Valo2013-09-08  2685
arvif-vdev_id);
60c3daa8 Kalle Valo2013-09-08  2686  
226a339b Bartosz Markowski 2013-09-26  2687 pdev_param = 
ar-wmi.pdev_param-beacon_tx_mode;
226a339b Bartosz Markowski 2013-09-26  2688 ret = 
ath10k_wmi_pdev_set_param(ar, pdev_param,
5e3dd157 Kalle Valo2013-06-12  2689 
WMI_BEACON_STAGGERED_MODE);
5e3dd157 Kalle Valo2013-06-12  2690 if (ret)
5e3dd157 Kalle Valo2013-06-12  2691 
ath10k_warn(Failed to set beacon mode for VDEV: %d\n,
5e3dd157 Kalle Valo2013-06-12  2692 
arvif-vdev_id);
5e3dd157 Kalle Valo2013-06-12  2693 }
5e3dd157 Kalle Valo2013-06-12  2694  
b70727e8 John W. Linville  2013-06-13  2695 if (changed  
BSS_CHANGED_BEACON_INFO) {
5e3dd157 Kalle Valo2013-06-12  2696 arvif-dtim_period = 
info-dtim_period;
5e3dd157 Kalle Valo2013-06-12  2697  
60c3daa8 Kalle Valo2013-09-08  2698 
ath10k_dbg(ATH10K_DBG_MAC,
60c3daa8 Kalle Valo2013-09-08  2699mac vdev %d 
dtim_period %d\n,
60c3daa8 Kalle Valo2013-09-08  2700
arvif-vdev_id, arvif-dtim_period);
60c3daa8 Kalle Valo2013-09-08  2701  
6d1506e7 Bartosz Markowski 2013-09-26  2702 vdev_param = 
ar-wmi.vdev_param-dtim_period;
6d1506e7 Bartosz Markowski 2013-09-26  2703 ret = 
ath10k_wmi_vdev_set_param(ar, arvif-vdev_id, vdev_param,
5e3dd157 Kalle Valo2013-06-12  2704 
arvif-dtim_period);
5e3dd157 Kalle Valo2013-06-12  2705 if (ret)
5e3dd157 Kalle Valo2013-06-12  2706 
ath10k_warn(Failed to set dtim period for VDEV: %d\n,
5e3dd157 Kalle Valo2013-06-12  2707 
arvif-vdev_id);
5e3dd157 Kalle Valo2013-06-12  2708 }
5e3dd157 Kalle Valo2013-06-12  2709  
5e3dd157 Kalle Valo2013-06-12  2710 if (changed  BSS_CHANGED_SSID 

5e3dd157 Kalle Valo2013-06-12  2711 

[kbuild] [xhci:for-usb-next-command-queue 4/10] drivers/usb/host/xhci-hub.c:326 xhci_stop_device() warn: inconsistent returns spin_lock:xhci-lock: locked (294 [(-12)]) unlocked (283 [(-12)], 326 [(-

2014-01-28 Thread Dan Carpenter
Hi Mathias,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci.git 
for-usb-next-command-queue
head:   f8480a8dea8e428b6ba1ae8f4a5ed0a7691de7ad
commit: 5d8ce20aa8ad5fa1bf7c14833eaa60b94a78321f [4/10] xhci: use command 
structures for xhci_queue_stop_endpoint()

drivers/usb/host/xhci-hub.c:326 xhci_stop_device() warn: inconsistent returns 
spin_lock:xhci-lock: locked (294 [(-12)]) unlocked (283 [(-12)], 326 [(-62)], 
326 [0])
drivers/usb/host/xhci-hub.c:326 xhci_stop_device() warn: inconsistent returns 
irqsave:flags: locked (294 [(-12)]) unlocked (283 [(-12)], 326 [(-62)], 326 [0])

git remote add xhci git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci.git
git remote update xhci
git checkout 5d8ce20aa8ad5fa1bf7c14833eaa60b94a78321f
vim +326 drivers/usb/host/xhci-hub.c

be88fe4f Andiry Xu 2010-10-14  310  if (timeleft = 0) {
be88fe4f Andiry Xu 2010-10-14  311  xhci_warn(xhci, %s while 
waiting for stop endpoint command\n,
be88fe4f Andiry Xu 2010-10-14  312  timeleft == 0 ? 
Timeout : Signal);
be88fe4f Andiry Xu 2010-10-14  313  spin_lock_irqsave(xhci-lock, 
flags);
be88fe4f Andiry Xu 2010-10-14  314  /* The timeout might have raced 
with the event ring handler, so
be88fe4f Andiry Xu 2010-10-14  315   * only delete from the list if 
the item isn't poisoned.
be88fe4f Andiry Xu 2010-10-14  316   */
be88fe4f Andiry Xu 2010-10-14  317  if (cmd-cmd_list.next != 
LIST_POISON1)
be88fe4f Andiry Xu 2010-10-14  318  
list_del(cmd-cmd_list);
be88fe4f Andiry Xu 2010-10-14  319  
spin_unlock_irqrestore(xhci-lock, flags);
be88fe4f Andiry Xu 2010-10-14  320  ret = -ETIME;
be88fe4f Andiry Xu 2010-10-14  321  goto command_cleanup;
be88fe4f Andiry Xu 2010-10-14  322  }
be88fe4f Andiry Xu 2010-10-14  323  
be88fe4f Andiry Xu 2010-10-14  324  command_cleanup:
be88fe4f Andiry Xu 2010-10-14  325  xhci_free_command(xhci, cmd);
be88fe4f Andiry Xu 2010-10-14 @326  return ret;
be88fe4f Andiry Xu 2010-10-14  327  }
be88fe4f Andiry Xu 2010-10-14  328  
be88fe4f Andiry Xu 2010-10-14  329  /*
be88fe4f Andiry Xu 2010-10-14  330   * Ring device, it rings the all doorbells 
unconditionally.
be88fe4f Andiry Xu 2010-10-14  331   */
56192531 Andiry Xu 2010-10-14  332  void xhci_ring_device(struct xhci_hcd 
*xhci, int slot_id)
be88fe4f Andiry Xu 2010-10-14  333  {
be88fe4f Andiry Xu 2010-10-14  334  int i;

---
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] [omap-audio:peter/topic/ti-audio-next-bnw-wip 4/31] sound/soc/soc-dapm.c:1755 dapm_widget_set_power() warn: was intended here instead of ||?

2014-01-28 Thread Dan Carpenter
Hi Liam,

FYI, there are new smatch warnings show up in

tree:   git://gitorious.org/omap-audio/linux-audio 
peter/topic/ti-audio-next-bnw-wip
head:   b21a772eb9594ad1d50a54efdbdcbe6be79d4e4a
commit: db7c56150e83b670d52cc07493e44eaca359d60a [4/31] ASoC: dapm: Allow path 
discovery for active DAI widgets

sound/soc/soc-dapm.c:1755 dapm_widget_set_power() warn: was  intended here 
instead of ||?

git remote add omap-audio git://gitorious.org/omap-audio/linux-audio
git remote update omap-audio
git checkout db7c56150e83b670d52cc07493e44eaca359d60a
vim +1755 sound/soc/soc-dapm.c

fe4fda5d Mark Brown2011-10-03  1739 if (!connect)
fe4fda5d Mark Brown2011-10-03  1740 return;
fe4fda5d Mark Brown2011-10-03  1741  
fe4fda5d Mark Brown2011-10-03  1742 /* If the peer is already in 
the state we're moving to then we
fe4fda5d Mark Brown2011-10-03  1743  * won't have an impact on it. 
*/
db7c5615 Liam Girdwood 2012-02-21  1744 if (power != peer-power || 
peer-id == snd_soc_dapm_dai_in ||
db7c5615 Liam Girdwood 2012-02-21  1745 peer-id == 
snd_soc_dapm_dai_out)
75c1f891 Mark Brown2011-10-04  1746 dapm_mark_dirty(peer, 
peer state change);
fe4fda5d Mark Brown2011-10-03  1747  }
fe4fda5d Mark Brown2011-10-03  1748  
05623c43 Mark Brown2011-09-28  1749  static void 
dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power,
05623c43 Mark Brown2011-09-28  1750   
struct list_head *up_list,
05623c43 Mark Brown2011-09-28  1751   
struct list_head *down_list)
05623c43 Mark Brown2011-09-28  1752  {
db432b41 Mark Brown2011-10-03  1753 struct snd_soc_dapm_path *path;
db432b41 Mark Brown2011-10-03  1754  
db7c5615 Liam Girdwood 2012-02-21 @1755 if (w-power == power 
db7c5615 Liam Girdwood 2012-02-21  1756 (w-id != 
snd_soc_dapm_dai_in || w-id != snd_soc_dapm_dai_out))
05623c43 Mark Brown2011-09-28  1757 return;
05623c43 Mark Brown2011-09-28  1758  
05623c43 Mark Brown2011-09-28  1759 
trace_snd_soc_dapm_widget_power(w, power);
05623c43 Mark Brown2011-09-28  1760  
db432b41 Mark Brown2011-10-03  1761 /* If we changed our power 
state perhaps our neigbours changed
fe4fda5d Mark Brown2011-10-03  1762  * also.
db432b41 Mark Brown2011-10-03  1763  */

---
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] [omap-audio:peter/topic/ti-audio-next-bnw-wip 18/31] sound/soc/soc-fw.c:945:9-16: ERROR: se is NULL but dereferenced.

2014-01-28 Thread Dan Carpenter
Hi Liam,

FYI, there are coccinelle warnings in

tree:   git://gitorious.org/omap-audio/linux-audio 
peter/topic/ti-audio-next-bnw-wip
head:   b21a772eb9594ad1d50a54efdbdcbe6be79d4e4a
commit: 7c6163f44cd6b375b3077ab566cf0e461474640b [18/31] ASoC: firmware: Add 
support for dynamic components

 sound/soc/soc-fw.c:945:9-16: ERROR: se is NULL but dereferenced.
--
 sound/soc/soc-fw.c:1425:8-9: ERROR: reference preceded by free on line 1425
 sound/soc/soc-fw.c:1465:8-9: ERROR: reference preceded by free on line 1465
   
--
 sound/soc/soc-fw.c:1510:6-8: ERROR: invalid reference to the index variable 
 of the iterator on line 1495
 sound/soc/soc-fw.c:1430:6-8: ERROR: invalid reference to the index variable 
 of the iterator on line 1415
 sound/soc/soc-fw.c:1470:6-8: ERROR: invalid reference to the index variable 
 of the iterator on line 1455

git remote add omap-audio git://gitorious.org/omap-audio/linux-audio
git remote update omap-audio
git checkout 7c6163f44cd6b375b3077ab566cf0e461474640b
vim +945 sound/soc/soc-fw.c

7c6163f4 Liam Girdwood 2012-12-05  929  goto err_se;
7c6163f4 Liam Girdwood 2012-12-05  930  }
7c6163f4 Liam Girdwood 2012-12-05  931  
7c6163f4 Liam Girdwood 2012-12-05  932  err = 
soc_fw_init_kcontrol(sfw, kc);
7c6163f4 Liam Girdwood 2012-12-05  933  if (err  0) {
7c6163f4 Liam Girdwood 2012-12-05  934  
dev_err(sfw-dev, ASoC: failed to init %s\n,
7c6163f4 Liam Girdwood 2012-12-05  935  
ec-hdr.name);
7c6163f4 Liam Girdwood 2012-12-05  936  goto err_se;
7c6163f4 Liam Girdwood 2012-12-05  937  }
7c6163f4 Liam Girdwood 2012-12-05  938  }
7c6163f4 Liam Girdwood 2012-12-05  939  return kc;
7c6163f4 Liam Girdwood 2012-12-05  940  
7c6163f4 Liam Girdwood 2012-12-05  941  err_se:
7c6163f4 Liam Girdwood 2012-12-05  942  kfree(kc);
7c6163f4 Liam Girdwood 2012-12-05  943  
7c6163f4 Liam Girdwood 2012-12-05  944  /* free values and texts */
7c6163f4 Liam Girdwood 2012-12-05 @945  if (se-dvalues)
7c6163f4 Liam Girdwood 2012-12-05  946  kfree(se-dvalues);
7c6163f4 Liam Girdwood 2012-12-05  947  for (i = 0; i  ec-max; i++)
7c6163f4 Liam Girdwood 2012-12-05  948  kfree(se-dtexts[i]);
7c6163f4 Liam Girdwood 2012-12-05  949  
7c6163f4 Liam Girdwood 2012-12-05  950  kfree(se);
7c6163f4 Liam Girdwood 2012-12-05  951  
7c6163f4 Liam Girdwood 2012-12-05  952  return NULL;
7c6163f4 Liam Girdwood 2012-12-05  953  }

---
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] [cgroup:review-post-kernfs-conversion 24/32] kernel/cgroup.c:1554 cgroup_mount() error: 'root' dereferencing possible ERR_PTR()

2014-01-29 Thread Dan Carpenter
[ I can't actually checkout that hash, but probably the bug report is
  correct. ]

Hi Tejun,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git 
review-post-kernfs-conversion
head:   f38cf7665be19d00532d12eb5ae057f12cffb924
commit: cd71b9c15a8f80b5ee9daa2aef006b95fe8d5cf8 [24/32] cgroup: convert to 
kernfs

kernel/cgroup.c:1554 cgroup_mount() error: 'root' dereferencing possible 
ERR_PTR()

git remote add cgroup 
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git
git remote update cgroup
git checkout cd71b9c15a8f80b5ee9daa2aef006b95fe8d5cf8
vim +/root +1554 kernel/cgroup.c

cd71b9c1 Tejun Heo   2014-01-28  1538   }
cd71b9c1 Tejun Heo   2014-01-28  1539  
cd71b9c1 Tejun Heo   2014-01-28  1540   ret = cgroup_setup_root(root);
cd71b9c1 Tejun Heo   2014-01-28  1541   if (ret)
cd71b9c1 Tejun Heo   2014-01-28  1542   cgroup_free_root(root);
cd71b9c1 Tejun Heo   2014-01-28  1543  
b6829d78 Tejun Heo   2014-01-28  1544  out_unlock:
e25e2cbb Tejun Heo   2011-12-12  1545   mutex_unlock(cgroup_mutex);
d685d7ed Tejun Heo   2014-01-28  1546   mutex_unlock(cgroup_tree_mutex);
b6829d78 Tejun Heo   2014-01-28  1547  
c6d57f33 Paul Menage 2009-09-23  1548   kfree(opts.release_agent);
c6d57f33 Paul Menage 2009-09-23  1549   kfree(opts.name);
b6829d78 Tejun Heo   2014-01-28  1550  
cd71b9c1 Tejun Heo   2014-01-28  1551   if (ret)
b6829d78 Tejun Heo   2014-01-28  1552   return ERR_PTR(ret);
cd71b9c1 Tejun Heo   2014-01-28  1553  
cd71b9c1 Tejun Heo   2014-01-28 @1554   dentry = kernfs_mount(fs_type, flags, 
root-kf_root);
cd71b9c1 Tejun Heo   2014-01-28  1555   if (IS_ERR(dentry))
cd71b9c1 Tejun Heo   2014-01-28  1556   cgroup_put_root(root);
cd71b9c1 Tejun Heo   2014-01-28  1557   return dentry;
cd71b9c1 Tejun Heo   2014-01-28  1558  }
cd71b9c1 Tejun Heo   2014-01-28  1559  
cd71b9c1 Tejun Heo   2014-01-28  1560  static void cgroup_kill_sb(struct 
super_block *sb)
cd71b9c1 Tejun Heo   2014-01-28  1561  {
cd71b9c1 Tejun Heo   2014-01-28  1562   struct kernfs_root *kf_root = 
kernfs_root_from_sb(sb);

---
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-gma500:blitter_hacking 10/10] drivers/gpu/drm/gma500/blitter.c:97:2-8: preceding lock on line 78

2014-02-07 Thread Dan Carpenter
Hi Patrik,

FYI, there are coccinelle warnings in

tree:   git://github.com/patjak/drm-gma500 blitter_hacking
head:   c0f1cbb1b1991f5dbb18be5f4c8d04d5b0addb79
commit: c0f1cbb1b1991f5dbb18be5f4c8d04d5b0addb79 [10/10] drm/gma500: Add 
blitter submit ioctl

 drivers/gpu/drm/gma500/blitter.c:97:2-8: preceding lock on line 78

git remote add drm-gma500 git://github.com/patjak/drm-gma500
git remote update drm-gma500
git checkout c0f1cbb1b1991f5dbb18be5f4c8d04d5b0addb79
vim +97 drivers/gpu/drm/gma500/blitter.c

c0f1cbb1 Patrik Jakobsson 2014-02-07   72  {
c0f1cbb1 Patrik Jakobsson 2014-02-07   73   int ret = 0;
c0f1cbb1 Patrik Jakobsson 2014-02-07   74   int i;
c0f1cbb1 Patrik Jakobsson 2014-02-07   75   unsigned submit_size;
c0f1cbb1 Patrik Jakobsson 2014-02-07   76   unsigned long flags;
c0f1cbb1 Patrik Jakobsson 2014-02-07   77  
c0f1cbb1 Patrik Jakobsson 2014-02-07  @78   
spin_lock_irqsave(dev_priv-lock_2d, flags);
c0f1cbb1 Patrik Jakobsson 2014-02-07   79  
c0f1cbb1 Patrik Jakobsson 2014-02-07   80   while (size  0) {
c0f1cbb1 Patrik Jakobsson 2014-02-07   81   submit_size = (size  
0x60) ? size : 0x60;
c0f1cbb1 Patrik Jakobsson 2014-02-07   82   size -= submit_size;
c0f1cbb1 Patrik Jakobsson 2014-02-07   83   ret = 
gma_blt_wait_available(dev_priv, submit_size);
c0f1cbb1 Patrik Jakobsson 2014-02-07   84   submit_size = 2;
c0f1cbb1 Patrik Jakobsson 2014-02-07   85  
c0f1cbb1 Patrik Jakobsson 2014-02-07   86   for (i = 0; i  
submit_size; i += 4) {
c0f1cbb1 Patrik Jakobsson 2014-02-07   87   
PSB_WSGX32(*cmdbuf++, PSB_SGX_2D_SLAVE_PORT + i);
c0f1cbb1 Patrik Jakobsson 2014-02-07   88   }
c0f1cbb1 Patrik Jakobsson 2014-02-07   89  
c0f1cbb1 Patrik Jakobsson 2014-02-07   90   
(void)PSB_RSGX32(PSB_SGX_2D_SLAVE_PORT + i - 4);
c0f1cbb1 Patrik Jakobsson 2014-02-07   91   }
c0f1cbb1 Patrik Jakobsson 2014-02-07   92  
c0f1cbb1 Patrik Jakobsson 2014-02-07   93   /* We currently sync our blits 
here */
c0f1cbb1 Patrik Jakobsson 2014-02-07   94   ret = 
gma_blt_wait_idle(dev_priv);
c0f1cbb1 Patrik Jakobsson 2014-02-07   95   if (ret) {
c0f1cbb1 Patrik Jakobsson 2014-02-07   96   
DRM_ERROR_DRIVER(Blitter hang!);
c0f1cbb1 Patrik Jakobsson 2014-02-07  @97   return ret;
c0f1cbb1 Patrik Jakobsson 2014-02-07   98   }
c0f1cbb1 Patrik Jakobsson 2014-02-07   99  
c0f1cbb1 Patrik Jakobsson 2014-02-07  100   
spin_unlock_irqrestore(dev_priv-lock_2d, 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 mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [char-misc:char-misc-next 29/29] drivers/w1/masters/ds1wm.c:339 ds1wm_search() error: double lock 'mutex:master_dev-bus_mutex'

2014-02-07 Thread Dan Carpenter
Hi David,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 
char-misc-next
head:   d3a8a9dbb903c73a7ec2deae4c9b7d74b6834f4c
commit: d3a8a9dbb903c73a7ec2deae4c9b7d74b6834f4c [29/29] w1: hold bus_mutex in 
netlink and search

drivers/w1/masters/ds1wm.c:339 ds1wm_search() error: double lock 
'mutex:master_dev-bus_mutex'
drivers/w1/masters/ds1wm.c:443 ds1wm_search() error: double unlock 
'mutex:master_dev-bus_mutex'

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 d3a8a9dbb903c73a7ec2deae4c9b7d74b6834f4c
vim +339 drivers/w1/masters/ds1wm.c

26a6afb9 Jean-François Dagenais2011-05-26  333  if (pass  100) 
{
26a6afb9 Jean-François Dagenais2011-05-26  334  
dev_dbg(ds1wm_data-pdev-dev,
26a6afb9 Jean-François Dagenais2011-05-26  335  
too many attempts (100), search aborted\n);
d3a8a9db David Fries   2014-01-15  336  break;
26a6afb9 Jean-François Dagenais2011-05-26  337  }
26a6afb9 Jean-François Dagenais2011-05-26  338  
b02f8bed NeilBrown 2012-05-18 @339  
mutex_lock(master_dev-bus_mutex);
26a6afb9 Jean-François Dagenais2011-05-26  340  if 
(ds1wm_reset(ds1wm_data)) {
b02f8bed NeilBrown 2012-05-18  341  
mutex_unlock(master_dev-bus_mutex);
26a6afb9 Jean-François Dagenais2011-05-26  342  
dev_dbg(ds1wm_data-pdev-dev,
26a6afb9 Jean-François Dagenais2011-05-26  343  
pass: %d reset error (or no slaves)\n, pass);
26a6afb9 Jean-François Dagenais2011-05-26  344  break;
26a6afb9 Jean-François Dagenais2011-05-26  345  }
26a6afb9 Jean-François Dagenais2011-05-26  346  
26a6afb9 Jean-François Dagenais2011-05-26  347  
dev_dbg(ds1wm_data-pdev-dev,
26a6afb9 Jean-François Dagenais2011-05-26  348  pass: 
%d r : %0#18llx writing SEARCH_ROM\n, pass, r);
26a6afb9 Jean-François Dagenais2011-05-26  349  
ds1wm_write(ds1wm_data, search_type);
26a6afb9 Jean-François Dagenais2011-05-26  350  
dev_dbg(ds1wm_data-pdev-dev,
26a6afb9 Jean-François Dagenais2011-05-26  351  pass: 
%d entering ASM\n, pass);
26a6afb9 Jean-François Dagenais2011-05-26  352  
ds1wm_write_register(ds1wm_data, DS1WM_CMD, DS1WM_CMD_SRA);
26a6afb9 Jean-François Dagenais2011-05-26  353  
dev_dbg(ds1wm_data-pdev-dev,
4907cb7b Anatol Pomozov2012-09-01  354  pass: 
%d beginning nibble loop\n, pass);
26a6afb9 Jean-François Dagenais2011-05-26  355  
26a6afb9 Jean-François Dagenais2011-05-26  356  r_prime = 0;
26a6afb9 Jean-François Dagenais2011-05-26  357  d = 0;
26a6afb9 Jean-François Dagenais2011-05-26  358  /* we work one 
nibble at a time */
26a6afb9 Jean-François Dagenais2011-05-26  359  /* each nibble 
is interleaved to form a byte */
26a6afb9 Jean-François Dagenais2011-05-26  360  for (i = 0; i  
16; i++) {
26a6afb9 Jean-François Dagenais2011-05-26  361  
26a6afb9 Jean-François Dagenais2011-05-26  362  
unsigned char resp, _r, _r_prime, _d;
26a6afb9 Jean-François Dagenais2011-05-26  363  
26a6afb9 Jean-François Dagenais2011-05-26  364  _r = (r 
 (4*i))  0xf;
26a6afb9 Jean-François Dagenais2011-05-26  365  _r = 
((_r  0x1)  1) |
26a6afb9 Jean-François Dagenais2011-05-26  366  ((_r  
0x2)  2) |
26a6afb9 Jean-François Dagenais2011-05-26  367  ((_r  
0x4)  3) |
26a6afb9 Jean-François Dagenais2011-05-26  368  ((_r  
0x8)  4);
26a6afb9 Jean-François Dagenais2011-05-26  369  
26a6afb9 Jean-François Dagenais2011-05-26  370  /* 
writes _r, then reads back: */
26a6afb9 Jean-François Dagenais2011-05-26  371  resp = 
ds1wm_read(ds1wm_data, _r);
26a6afb9 Jean-François Dagenais2011-05-26  372  
26a6afb9 Jean-François Dagenais2011-05-26  373  if 
(ds1wm_data-read_error) {
26a6afb9 Jean-François Dagenais2011-05-26  374  
dev_err(ds1wm_data-pdev-dev,
26a6afb9 Jean-François Dagenais2011-05-26  375  
pass: %d nibble: %d read error\n, pass, i);
26a6afb9 Jean-François Dagenais2011-05-26  376  
break;
26a6afb9 Jean-François Dagenais2011-05-26  377  }
26a6afb9 Jean-François Dagenais2011-05-26  378  
26a6afb9 Jean-François Dagenais2011-05-26  379  
_r_prime = ((resp  0x02)  1) |
26a6afb9 Jean-François Dagenais

Re: [kbuild] kernfs: implement kernfs_get_parent(), kernfs_name/path() and friends

2014-02-10 Thread Dan Carpenter
Hello Tejun Heo,

This is a semi-automatic email about new static checker warnings.

The patch 3eef34ad7dc3: kernfs: implement kernfs_get_parent(), 
kernfs_name/path() and friends from Feb 7, 2014, leads to the 
following Smatch complaint:

fs/kernfs/dir.c:1298 kernfs_rename_ns()
 error: we previously assumed 'new_name' could be null (see line 1289)

fs/kernfs/dir.c
  1288  kn-ns = new_ns;
  1289  if (new_name) {

Check.

  1290  if (!(kn-flags  KERNFS_STATIC_NAME))
  1291  old_name = kn-name;
  1292  kn-flags = ~KERNFS_STATIC_NAME;
  1293  kn-name = new_name;
  1294  }
  1295  
  1296  spin_unlock_irq(kernfs_rename_lock);
  1297  
  1298  kn-hash = kernfs_name_hash(new_name, new_ns);

Dereference.

  1299  kernfs_link_sibling(kn);
  1300  

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


Re: [kbuild] [staging:staging-next 124/151] drivers/staging/bcm/Bcmchar.c:816 bcm_char_ioctl_buffer_download_start() warn: inconsistent returns sem:Adapter-NVMRdmWrmLock: locked (798 [(-16)]) unlock

2014-02-14 Thread Dan Carpenter
Not really new.  This code won't move out of staging until these are
fixed.

regards,
dan carpenter


On Fri, Feb 14, 2014 at 10:54:35AM +0800, kbuild test robot wrote:
 TO: Dave Jones da...@redhat.com
 CC: Greg Kroah-Hartman gre...@linuxfoundation.org
 
 
 Hi Dave,
 
 FYI, there are new smatch warnings show up in
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
 staging-next
 head:   84f7a542f9e0191b6f7ab87881a050889576a5c4
 commit: 79f99494892c8bd7e7464ee273d8a43fc08c406d [124/151] staging/bcm: move 
 IOCTL_BCM_BUFFER_DOWNLOAD_START case out to its own function.
 :: branch date: 5 hours ago
 :: commit date: 6 hours ago
 
 New smatch warnings:
 drivers/staging/bcm/Bcmchar.c:816 bcm_char_ioctl_buffer_download_start() 
 warn: inconsistent returns sem:Adapter-NVMRdmWrmLock: locked (798 [(-16)]) 
 unlocked (791 [(-13)], 811 [s32min-(-1),1-s32max], 816 [0])
 
 Old smatch warnings:
 drivers/staging/bcm/Bcmchar.c:839 bcm_char_ioctl() warn: bitwise AND 
 condition is false here
 drivers/staging/bcm/Bcmchar.c:935 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:943 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:949 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:954 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:964 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:988 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1004 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1019 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 drivers/staging/bcm/Bcmchar.c:1054 bcm_char_ioctl() error: double unlock 
 'sem:Adapter-fw_download_sema'
 
 git remote add staging 
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
 git remote update staging
 git checkout 79f99494892c8bd7e7464ee273d8a43fc08c406d
 vim +816 drivers/staging/bcm/Bcmchar.c
 
 79f99494 Dave Jones2014-02-13  800Adapter-bBinDownloaded = false;
 79f99494 Dave Jones2014-02-13  801
 Adapter-fw_download_process_pid = current-pid;
 79f99494 Dave Jones2014-02-13  802Adapter-bCfgDownloaded = false;
 79f99494 Dave Jones2014-02-13  803Adapter-fw_download_done = 
 false;
 79f99494 Dave Jones2014-02-13  804netif_carrier_off(Adapter-dev);
 79f99494 Dave Jones2014-02-13  805netif_stop_queue(Adapter-dev);
 79f99494 Dave Jones2014-02-13  806Status = 
 reset_card_proc(Adapter);
 79f99494 Dave Jones2014-02-13  807if (Status) {
 79f99494 Dave Jones2014-02-13  808pr_err(PFX %s: 
 reset_card_proc Failed!\n, Adapter-dev-name);
 79f99494 Dave Jones2014-02-13  809
 up(Adapter-fw_download_sema);
 79f99494 Dave Jones2014-02-13  810
 up(Adapter-NVMRdmWrmLock);
 79f99494 Dave Jones2014-02-13  811return Status;
 79f99494 Dave Jones2014-02-13  812}
 79f99494 Dave Jones2014-02-13  813mdelay(10);
 79f99494 Dave Jones2014-02-13  814  
 79f99494 Dave Jones2014-02-13  815up(Adapter-NVMRdmWrmLock);
 79f99494 Dave Jones2014-02-13 @816return Status;
 79f99494 Dave Jones2014-02-13  817  }
 79f99494 Dave Jones2014-02-13  818  
 0566ee95 Dave Jones2014-02-13  819  
 9f1c75ac Arnd Bergmann 2010-09-30  820  static long bcm_char_ioctl(struct 
 file *filp, UINT cmd, ULONG arg)
 f8942e07 Stephen Hemminger 2010-09-08  821  {
 774bea83 Kevin McKinney2012-05-26  822struct bcm_tarang_data *pTarang 
 = filp-private_data;
 ada692b0 Stephen Hemminger 2010-11-01  823void __user *argp = (void 
 __user *)arg;
 2979460d Kevin McKinney2012-05-26  824struct bcm_mini_adapter 
 *Adapter = pTarang-Adapter;
 
 ---
 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 96/108] net/tipc/node.c:258 tipc_node_detach_link() error: buffer overflow 'n_ptr-links' 2 = 2

2014-02-14 Thread Dan Carpenter
This is a style question and not a real bug:

Which is better:

OPTION #1: ignore static checker warnings

for (i = 0; i  ARRAY_SIZE(x); i++) {
if (found)
break;
}
x[i] = 0;


OPTION #2: stop on the last element

for (i = 0; i  ARRAY_SIZE(x) - 1; i++) {
if (found)
break;
}
x[i] = 0;


OPTION #3: add a bogus error test

for (i = 0; i  ARRAY_SIZE(x); i++) {
if (found)
break;
}
if (i == ARRAY_SIZE(x))
return;
x[i] = 0;

OPTION #4: convoluted code

for (i = 0; i  ARRAY_SIZE(x); i++) {
if (!found)
continue;
x[i] = 0;
break;
}

It's not clear to me what the right answer is...

regards,
dan carpenter

-

Hi Jon,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   d4f2fa6ad61ec1db713569a179183df4d0fc6ae7
commit: 7d33939f475d403e79124e3143d7951dcfe8629f [96/108] tipc: delay delete of 
link when failover is needed
:: branch date: 5 hours ago
:: commit date: 5 hours ago

net/tipc/node.c:258 tipc_node_detach_link() error: buffer overflow 
'n_ptr-links' 2 = 2

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 7d33939f475d403e79124e3143d7951dcfe8629f
vim +258 net/tipc/node.c

b97bf3fd Per Liden   2006-01-02  242  
a18c4bc3 Paul Gortmaker  2011-12-29  243  void tipc_node_attach_link(struct 
tipc_node *n_ptr, struct tipc_link *l_ptr)
b97bf3fd Per Liden   2006-01-02  244  {
37b9c08a Allan Stephens  2011-02-28  245
n_ptr-links[l_ptr-b_ptr-identity] = l_ptr;
37b9c08a Allan Stephens  2011-02-28  246atomic_inc(tipc_num_links);
37b9c08a Allan Stephens  2011-02-28  247n_ptr-link_cnt++;
b97bf3fd Per Liden   2006-01-02  248  }
b97bf3fd Per Liden   2006-01-02  249  
a18c4bc3 Paul Gortmaker  2011-12-29  250  void tipc_node_detach_link(struct 
tipc_node *n_ptr, struct tipc_link *l_ptr)
b97bf3fd Per Liden   2006-01-02  251  {
7d33939f Jon Paul Maloy  2014-02-13  252int i;
7d33939f Jon Paul Maloy  2014-02-13  253  
7d33939f Jon Paul Maloy  2014-02-13  254for (i = 0; i  MAX_BEARERS; 
i++) {
7d33939f Jon Paul Maloy  2014-02-13  255if (l_ptr == 
n_ptr-links[i])
7d33939f Jon Paul Maloy  2014-02-13  256break;
7d33939f Jon Paul Maloy  2014-02-13  257}
7d33939f Jon Paul Maloy  2014-02-13 @258n_ptr-links[i] = NULL;
d1bcb115 Allan Stephens  2011-02-25  259atomic_dec(tipc_num_links);
b97bf3fd Per Liden   2006-01-02  260n_ptr-link_cnt--;
b97bf3fd Per Liden   2006-01-02  261  }
b97bf3fd Per Liden   2006-01-02  262  
6c00055a David S. Miller 2008-09-02  263  static void 
node_established_contact(struct tipc_node *n_ptr)
b97bf3fd Per Liden   2006-01-02  264  {
51a8e4de Allan Stephens  2010-12-31  265
tipc_k_signal((Handler)tipc_named_node_up, n_ptr-addr);
c64f7a6a Jon Maloy   2012-11-16  266n_ptr-bclink.oos_state = 0;

---
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 98/108] net/tipc/link.c:2616 tipc_link_cmd_reset_stats() warn: inconsistent returns spin_lock:node-lock: locked (2611 [s32min-s32max], 2616 [s32min-s32max]) unlocked (2592

2014-02-14 Thread Dan Carpenter
The real bug is that bottom_half is unbalanced because we lock with
spin_lock(node-lock) but tipc_node_unlock() which calls
spin_unlock_bh().

regards,
dan carpenter

---

Hi Jon,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   d4f2fa6ad61ec1db713569a179183df4d0fc6ae7
commit: e099e86c9e24fe9aff36773600543eb31d8954d1 [98/108] tipc: add node_lock 
protection to link lookup function

net/tipc/link.c:2616 tipc_link_cmd_reset_stats() warn: inconsistent returns 
spin_lock:node-lock: locked (2611 [s32min-s32max], 2616 [s32min-s32max]) 
unlocked (2592 [s32min-s32max], 2597 [s32min-s32max], 2598 [s32min-s32max], 
2604 [s32min-s32max])

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 e099e86c9e24fe9aff36773600543eb31d8954d1
vim +2616 net/tipc/link.c

4323add6 Per Liden  2006-01-18  2600read_lock_bh(tipc_net_lock);
e099e86c Jon Paul Maloy 2014-02-13  2601node = 
tipc_link_find_owner(link_name, bearer_id);
e099e86c Jon Paul Maloy 2014-02-13  2602if (!node) {
e099e86c Jon Paul Maloy 2014-02-13  2603
read_unlock_bh(tipc_net_lock);
e099e86c Jon Paul Maloy 2014-02-13  2604return 
tipc_cfg_reply_error_string(link not found);
e099e86c Jon Paul Maloy 2014-02-13  2605}
e099e86c Jon Paul Maloy 2014-02-13  2606spin_lock(node-lock);
e099e86c Jon Paul Maloy 2014-02-13  2607l_ptr = node-links[bearer_id];
b97bf3fd Per Liden  2006-01-02  2608if (!l_ptr) {
e099e86c Jon Paul Maloy 2014-02-13  2609tipc_node_unlock(node);
4323add6 Per Liden  2006-01-18  2610
read_unlock_bh(tipc_net_lock);
4323add6 Per Liden  2006-01-18  2611return 
tipc_cfg_reply_error_string(link not found);
b97bf3fd Per Liden  2006-01-02  2612}
b97bf3fd Per Liden  2006-01-02  2613link_reset_statistics(l_ptr);
4323add6 Per Liden  2006-01-18  2614tipc_node_unlock(node);
4323add6 Per Liden  2006-01-18  2615read_unlock_bh(tipc_net_lock);
4323add6 Per Liden  2006-01-18 @2616return tipc_cfg_reply_none();
b97bf3fd Per Liden  2006-01-02  2617  }
b97bf3fd Per Liden  2006-01-02  2618  
b97bf3fd Per Liden  2006-01-02  2619  /**
b97bf3fd Per Liden  2006-01-02  2620   * percent - convert count to a 
percentage of total (rounding up or down)
b97bf3fd Per Liden  2006-01-02  2621   */
b97bf3fd Per Liden  2006-01-02  2622  static u32 percent(u32 count, u32 
total)
b97bf3fd Per Liden  2006-01-02  2623  {
b97bf3fd Per Liden  2006-01-02  2624return (count * 100 + (total / 
2)) / total;

---
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 40/57] net/appletalk/ddp.c:1811:2-45: code aligned with following code on line 1812

2014-02-16 Thread Dan Carpenter
Hi wangweidong,

FYI, there are coccinelle warnings in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   c1b5994770ad5ae03336b5cdd1e0ad622a870a00
commit: 7b30600cc653be63cfa434e49acc3c434699ae0b [40/57] appletalk: fix 
checkpatch error with indent

 net/appletalk/ddp.c:1811:2-45: code aligned with following code on line 1812

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 7b30600cc653be63cfa434e49acc3c434699ae0b
vim +1811 net/appletalk/ddp.c

7b30600c wangweidong2014-02-14  1805 * user tasks fiddle 
here
7b30600c wangweidong2014-02-14  1806 */
7b30600c wangweidong2014-02-14  1807struct sk_buff *skb = 
skb_peek(sk-sk_receive_queue);
7b30600c wangweidong2014-02-14  1808long amount = 0;
^1da177e Linus Torvalds 2005-04-16  1809  
7b30600c wangweidong2014-02-14  1810if (skb)
7b30600c wangweidong2014-02-14 @1811amount = skb-len - 
sizeof(struct ddpehdr);
7b30600c wangweidong2014-02-14 @1812rc = put_user(amount, 
(int __user *)argp);
7b30600c wangweidong2014-02-14  1813break;
7b30600c wangweidong2014-02-14  1814}
7b30600c wangweidong2014-02-14  1815case SIOCGSTAMP:

---
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] IB/mlx4: Build the port IBoE GID table properly under bonding

2014-02-18 Thread Dan Carpenter
On Mon, Feb 17, 2014 at 09:52:16PM +0200, Or Gerlitz wrote:
 On Mon, Feb 17, 2014, Dan Carpenter dan.carpen...@oracle.com wrote:
  Hello Moni Shoua,
  This is a semi-automatic email about new static checker warnings.
 
  The patch ad4885d279b6: IB/mlx4: Build the port IBoE GID table
  properly under bonding from Feb 5, 2014, leads to the following
 Smatch complaint:
 
 Hi Dan,
 
 I'd like to act such that our patches go through your 0-day testing of
 static checkers before submissions. For that end, do I just need to
 set up publicly accessible git tree anywhere I like and let you know,
 or it needs to be on kernel.org?
 

So, this wasn't a 0-day thing, right?  I am not sure why 0-day missed
it.  Perhaps the cross function database didn't have enough information.

You'd have to ask Fengguang about 0-day.  I know all the the git trees
in linux-next are a part of 0-day and all the branches get tested.
Presumably you would set up a separate branch for 0-day pre-testing.

Btw, I was so proud of this warning.  It is very complicated for a
static checker to know that curr_netdev is non-NULL on line 1743.

regards,
dan carpenter

 thanks,
 
 Or.
 
 
  drivers/infiniband/hw/mlx4/main.c:1749 mlx4_ib_scan_netdevs()
   error: we previously assumed 'curr_netdev' could be null (see line 
  1722)
 
  drivers/infiniband/hw/mlx4/main.c
1721
1722  if (curr_netdev) {
  ^^^
  Check.
 
1723  port_state = (netif_running(curr_netdev)  
  netif_carrier_ok(curr_netdev)) ?
1724  IB_PORT_ACTIVE : 
  IB_PORT_DOWN;
1725  mlx4_ib_set_default_gid(ibdev, curr_netdev, 
  port);
1726  } else {
1727  reset_gid_table(ibdev, port);
1728  }
1729  /* if using bonding/team and a slave port is down, 
  we don't the bond IP
1730   * based gids in the table since flows that select 
  port by gid may get
1731   * the down port.
1732   */
1733  if (curr_master  (port_state == IB_PORT_DOWN)) {
1734  reset_gid_table(ibdev, port);
1735  mlx4_ib_set_default_gid(ibdev, curr_netdev, 
  port);
1736  }
1737  /* if bonding is used it is possible that we add it 
  to masters
1738   * only after IP address is assigned to the net 
  bonding
1739   * interface.
1740  */
1741  if (curr_master  (old_master != curr_master)) {
1742  reset_gid_table(ibdev, port);
1743  mlx4_ib_set_default_gid(ibdev, curr_netdev, 
  port);
1744  mlx4_ib_get_dev_addr(curr_master, ibdev, 
  port);
1745  }
1746
1747  if (!curr_master  (old_master != curr_master)) {
1748  reset_gid_table(ibdev, port);
1749  mlx4_ib_set_default_gid(ibdev, curr_netdev, 
  port);
 ^^^
  Dereferenced without checking.
 
1750  mlx4_ib_get_dev_addr(curr_netdev, ibdev, 
  port);
1751  }
 
  regards,
  dan carpenter
  --
  To unsubscribe from this list: send the line unsubscribe linux-rdma in
  the body of a message to majord...@vger.kernel.org
  More majordomo info at  http://vger.kernel.org/majordomo-info.html
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


[kbuild] [net-next:master 161/168] net/ieee802154/nl-phy.c:440 phy_set_csma_params() warn: impossible condition '(retries -1) = (0-255 (-1))'

2014-02-18 Thread Dan Carpenter
Hi Phoebe,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   cb6e926e3f734f0934d3cb5cd7c827158183d367
commit: 4244db1b0b7bc9ab7b67d8c1c38de6cf15bc87a8 [161/168] ieee802154: add 
netlink APIs for smartMAC configuration

net/ieee802154/nl-phy.c:440 phy_set_csma_params() warn: impossible condition 
'(retries  -1) = (0-255  (-1))'

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 4244db1b0b7bc9ab7b67d8c1c38de6cf15bc87a8
vim +440 net/ieee802154/nl-phy.c

6ca00197 Phoebe Buckheister 2014-02-17  424  
4244db1b Phoebe Buckheister 2014-02-17  425  static int 
phy_set_csma_params(struct wpan_phy *phy, struct genl_info *info)
4244db1b Phoebe Buckheister 2014-02-17  426  {
4244db1b Phoebe Buckheister 2014-02-17  427 int rc;
4244db1b Phoebe Buckheister 2014-02-17  428 u8 min_be = phy-min_be;
4244db1b Phoebe Buckheister 2014-02-17  429 u8 max_be = phy-max_be;
4244db1b Phoebe Buckheister 2014-02-17  430 u8 retries = phy-csma_retries;
4244db1b Phoebe Buckheister 2014-02-17  431  
4244db1b Phoebe Buckheister 2014-02-17  432 if 
(info-attrs[IEEE802154_ATTR_CSMA_RETRIES])
4244db1b Phoebe Buckheister 2014-02-17  433 retries = 
nla_get_u8(info-attrs[IEEE802154_ATTR_CSMA_RETRIES]);
4244db1b Phoebe Buckheister 2014-02-17  434 if 
(info-attrs[IEEE802154_ATTR_CSMA_MIN_BE])
4244db1b Phoebe Buckheister 2014-02-17  435 min_be = 
nla_get_u8(info-attrs[IEEE802154_ATTR_CSMA_MIN_BE]);
4244db1b Phoebe Buckheister 2014-02-17  436 if 
(info-attrs[IEEE802154_ATTR_CSMA_MAX_BE])
4244db1b Phoebe Buckheister 2014-02-17  437 max_be = 
nla_get_u8(info-attrs[IEEE802154_ATTR_CSMA_MAX_BE]);
4244db1b Phoebe Buckheister 2014-02-17  438  
4244db1b Phoebe Buckheister 2014-02-17  439 if (retries  5 || max_be  8 
|| min_be  max_be ||
4244db1b Phoebe Buckheister 2014-02-17 @440 retries  -1 || retries  7)
4244db1b Phoebe Buckheister 2014-02-17  441 return -EINVAL;
4244db1b Phoebe Buckheister 2014-02-17  442  
4244db1b Phoebe Buckheister 2014-02-17  443 rc = phy-set_csma_params(phy, 
min_be, max_be, retries);
4244db1b Phoebe Buckheister 2014-02-17  444 if (rc  0)
4244db1b Phoebe Buckheister 2014-02-17  445 return rc;
4244db1b Phoebe Buckheister 2014-02-17  446  
4244db1b Phoebe Buckheister 2014-02-17  447 phy-min_be = min_be;
4244db1b Phoebe Buckheister 2014-02-17  448 phy-max_be = max_be;

---
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: bcmgenet: add main driver file

2014-02-18 Thread Dan Carpenter
[ Oops.  I sent the last one too quickly.  Here is another I should have
  included. ]

Hello Florian Fainelli,

This is a semi-automatic email about new static checker warnings.

The patch 1c1008c793fa: net: bcmgenet: add main driver file from
Feb 13, 2014, leads to the following Smatch complaint:

drivers/net/ethernet/broadcom/genet/bcmgenet.c:2171 bcmgenet_close()
 error: we previously assumed 'priv-phydev' could be null (see line 
2137)

drivers/net/ethernet/broadcom/genet/bcmgenet.c
  2136  
  2137  if (priv-phydev)

Check.

  2138  phy_stop(priv-phydev);
  2139  
  2140  /* Disable MAC receive */
  2141  reg = bcmgenet_umac_readl(priv, UMAC_CMD);
  2142  reg = ~CMD_RX_EN;
  2143  bcmgenet_umac_writel(priv, reg, UMAC_CMD);
  2144  
  2145  netif_tx_stop_all_queues(dev);
  2146  
  2147  ret = bcmgenet_dma_teardown(priv);
  2148  if (ret)
  2149  return ret;
  2150  
  2151  /* Disable MAC transmit. TX DMA disabled have to done before 
this */
  2152  reg = bcmgenet_umac_readl(priv, UMAC_CMD);
  2153  reg = ~CMD_TX_EN;
  2154  bcmgenet_umac_writel(priv, reg, UMAC_CMD);
  2155  
  2156  napi_disable(priv-napi);
  2157  
  2158  /* tx reclaim */
  2159  bcmgenet_tx_reclaim_all(dev);
  2160  bcmgenet_fini_dma(priv);
  2161  
  2162  free_irq(priv-irq0, priv);
  2163  free_irq(priv-irq1, priv);
  2164  
  2165  /* Wait for pending work items to complete - we are stopping
  2166   * the clock now. Since interrupts are disabled, no new work
  2167   * will be scheduled.
  2168   */
  2169  cancel_work_sync(priv-bcmgenet_irq_work);
  2170  
  2171  if (phy_is_internal(priv-phydev))

Unchecked dereference.

  2172  bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
  2173  

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


Re: [kbuild] net: bcmgenet: add main driver file

2014-02-18 Thread Dan Carpenter
Hello Florian Fainelli,

This is a semi-automatic email about new static checker warnings.

The patch 1c1008c793fa: net: bcmgenet: add main driver file from
Feb 13, 2014, leads to the following Smatch complaint:

drivers/net/ethernet/broadcom/genet/bcmgenet.c:2061 bcmgenet_open()
 warn: variable dereferenced before check 'priv-phydev' (see line 2014)

drivers/net/ethernet/broadcom/genet/bcmgenet.c
  2052  priv-crc_fwd_en = !!(reg  CMD_CRC_FWD);
  2053  
  2054  device_set_wakeup_capable(dev-dev, 1);
  2055  
  2056  if (phy_is_internal(priv-phydev))

Dereference.

  2057  bcmgenet_power_up(priv, GENET_POWER_PASSIVE);
  2058  
  2059  netif_tx_start_all_queues(dev);
  2060  
  2061  if (priv-phydev)

Check.

  2062  phy_start(priv-phydev);
  2063  

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


Re: [kbuild] [net-next:master 77/82] net/tipc/socket.c:1572 tipc_connect() warn: missing break? reassigning 'res'

2014-02-19 Thread Dan Carpenter
Falls through intentionally, but there is no comment.

regards,
dan carpenter

On Wed, Feb 19, 2014 at 07:31:53AM +0800, kbuild test robot wrote:
 TO: Ying Xue ying@windriver.com
 
 
 Hi Ying,
 
 FYI, there are new smatch warnings show up in
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
 master
 head:   f7b12606b5de323a2bb5ca1696558efde8f25441
 commit: 247f0f3c3176c55b46cb9a20011d3d6757634815 [77/82] tipc: align tipc 
 function names with common naming practice in the network
 :: branch date: 16 minutes ago
 :: commit date: 60 minutes ago
 
 net/tipc/socket.c:1572 tipc_connect() warn: missing break? reassigning 'res'
 
 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 247f0f3c3176c55b46cb9a20011d3d6757634815
 vim +/res +1572 net/tipc/socket.c
 
 584d24b3 Ying Xue 2012-11-29  1556 * indicate send_msg() is never 
 blocked.
 584d24b3 Ying Xue 2012-11-29  1557 */
 584d24b3 Ying Xue 2012-11-29  1558if (!timeout)
 584d24b3 Ying Xue 2012-11-29  1559m.msg_flags = 
 MSG_DONTWAIT;
 584d24b3 Ying Xue 2012-11-29  1560  
 247f0f3c Ying Xue 2014-02-18  1561res = tipc_sendmsg(NULL, sock, 
 m, 0);
 584d24b3 Ying Xue 2012-11-29  1562if ((res  0)  (res != 
 -EWOULDBLOCK))
 584d24b3 Ying Xue 2012-11-29  1563goto exit;
 584d24b3 Ying Xue 2012-11-29  1564  
 584d24b3 Ying Xue 2012-11-29  1565/* Just entered SS_CONNECTING 
 state; the only
 584d24b3 Ying Xue 2012-11-29  1566 * difference is that return 
 value in non-blocking
 584d24b3 Ying Xue 2012-11-29  1567 * case is EINPROGRESS, rather 
 than EALREADY.
 584d24b3 Ying Xue 2012-11-29  1568 */
 584d24b3 Ying Xue 2012-11-29  1569res = -EINPROGRESS;
 584d24b3 Ying Xue 2012-11-29  1570case SS_CONNECTING:
 78eb3a53 Ying Xue 2014-01-17  1571if (previous == SS_CONNECTING)
 78eb3a53 Ying Xue 2014-01-17 @1572res = -EALREADY;
 78eb3a53 Ying Xue 2014-01-17  1573if (!timeout)
 78eb3a53 Ying Xue 2014-01-17  1574goto exit;
 78eb3a53 Ying Xue 2014-01-17  1575timeout = 
 msecs_to_jiffies(timeout);
 78eb3a53 Ying Xue 2014-01-17  1576/* Wait until an 'ACK' or 'RST' 
 arrives, or a timeout occurs */
 78eb3a53 Ying Xue 2014-01-17  1577res = 
 tipc_wait_for_connect(sock, timeout);
 584d24b3 Ying Xue 2012-11-29  1578break;
 584d24b3 Ying Xue 2012-11-29  1579case SS_CONNECTED:
 584d24b3 Ying Xue 2012-11-29  1580res = -EISCONN;
 
 :: The code at line 1572 was first introduced by commit
 :: 78eb3a5379a52f291556483ea55b8a37e2ed4d5b tipc: standardize connect 
 routine
 
 :: TO: Ying Xue ying@windriver.com
 :: CC: David S. Miller da...@davemloft.net
 
 ---
 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 38/45] drivers/net/wireless/ath/ath10k/htt_tx.c:505 ath10k_htt_tx() warn: potential pointer math issue ('skb_cb-htt.txbuf' is a 352 bit pointer)

2014-02-19 Thread Dan Carpenter
Hi Michal,

FYI, there are new smatch warnings show up in

tree:   git://github.com/kvalo/ath ath-next-test
head:   4e53f6a3f1aac1a4a2d18f487f6e570b9402adc7
commit: 20b784ea3fb89de48c794cd889104aba64242f3b [38/45] [RFC/RFT 4/7] ath10k: 
bypass htc for htt tx path

drivers/net/wireless/ath/ath10k/htt_tx.c:505 ath10k_htt_tx() warn: potential 
pointer math issue ('skb_cb-htt.txbuf' is a 352 bit pointer)

git remote add ath6kl git://github.com/kvalo/ath
git remote update ath6kl
git checkout 20b784ea3fb89de48c794cd889104aba64242f3b
vim +505 drivers/net/wireless/ath/ath10k/htt_tx.c

20b784ea Michal Kazior 2014-02-17  489  
skb_cb-htt.txbuf-cmd_tx.flags0  = flags0;
20b784ea Michal Kazior 2014-02-17  490  
skb_cb-htt.txbuf-cmd_tx.flags1  = __cpu_to_le16(flags1);
20b784ea Michal Kazior 2014-02-17  491  skb_cb-htt.txbuf-cmd_tx.len   
  = __cpu_to_le16(msdu-len);
20b784ea Michal Kazior 2014-02-17  492  skb_cb-htt.txbuf-cmd_tx.id
  = __cpu_to_le16(msdu_id);
20b784ea Michal Kazior 2014-02-17  493  
skb_cb-htt.txbuf-cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr);
20b784ea Michal Kazior 2014-02-17  494  
skb_cb-htt.txbuf-cmd_tx.peerid  = __cpu_to_le32(HTT_INVALID_PEERID);
20b784ea Michal Kazior 2014-02-17  495  
20b784ea Michal Kazior 2014-02-17  496  ath10k_dbg(ATH10K_DBG_HTT,
20b784ea Michal Kazior 2014-02-17  497 htt tx flags0 %hhu 
flags1 %hu len %d id %hu frags_paddr %08x, msdu_paddr %08x vdev %hhu tid 
%hhu\n,
20b784ea Michal Kazior 2014-02-17  498 flags0, flags1, 
msdu-len, msdu_id, frags_paddr,
20b784ea Michal Kazior 2014-02-17  499 (u32)skb_cb-paddr, 
vdev_id, tid);
20b784ea Michal Kazior 2014-02-17  500  
ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, htt tx msdu: ,
20b784ea Michal Kazior 2014-02-17  501  msdu-data, 
msdu-len);
5e3dd157 Kalle Valo2013-06-12  502  
20b784ea Michal Kazior 2014-02-17  503  sg_items[0].transfer_id = 0;
20b784ea Michal Kazior 2014-02-17  504  sg_items[0].transfer_context = 
NULL;
20b784ea Michal Kazior 2014-02-17 @505  sg_items[0].vaddr = 
skb_cb-htt.txbuf +
20b784ea Michal Kazior 2014-02-17  506  
sizeof(skb_cb-htt.txbuf-frags);
20b784ea Michal Kazior 2014-02-17  507  sg_items[0].paddr = 
skb_cb-htt.txbuf_paddr +
20b784ea Michal Kazior 2014-02-17  508  
sizeof(skb_cb-htt.txbuf-frags);
20b784ea Michal Kazior 2014-02-17  509  sg_items[0].len = 
sizeof(skb_cb-htt.txbuf-htc_hdr) +
20b784ea Michal Kazior 2014-02-17  510
sizeof(skb_cb-htt.txbuf-cmd_hdr) +
20b784ea Michal Kazior 2014-02-17  511
sizeof(skb_cb-htt.txbuf-cmd_tx);
20b784ea Michal Kazior 2014-02-17  512  
20b784ea Michal Kazior 2014-02-17  513  sg_items[1].transfer_id = 0;

---
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:topic/asoc-enum-fixes 59/102] sound/soc/codecs/wm8995.c:887:14: sparse: duplicate const

2014-02-19 Thread Dan Carpenter
Hi Takashi,

FYI, there are new sparse warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git 
topic/asoc-enum-fixes
head:   cd968dad05210af141503aa10b796bf325b0c144
commit: b67b9dcee6b29477b0b618269d1c413ea2074c78 [59/102] ASoC: wm8995: Use 
SOC_ENUM_SINGLE_DECL()
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

 sound/soc/codecs/wm8995.c:887:14: sparse: duplicate const 

git remote add sound 
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
git remote update sound
git checkout b67b9dcee6b29477b0b618269d1c413ea2074c78
vim +887 sound/soc/codecs/wm8995.c

6a504a75 Dimitris Papastamos 2010-12-22  8711, 1, 0),
6a504a75 Dimitris Papastamos 2010-12-22  872SOC_DAPM_SINGLE(AIF1.1 
Switch, WM8995_DAC2_RIGHT_MIXER_ROUTING,
6a504a75 Dimitris Papastamos 2010-12-22  8730, 1, 0),
6a504a75 Dimitris Papastamos 2010-12-22  874  };
6a504a75 Dimitris Papastamos 2010-12-22  875  
6a504a75 Dimitris Papastamos 2010-12-22  876  static const struct 
snd_kcontrol_new in1l_pga =
6a504a75 Dimitris Papastamos 2010-12-22  877SOC_DAPM_SINGLE(IN1L Switch, 
WM8995_POWER_MANAGEMENT_2, 5, 1, 0);
6a504a75 Dimitris Papastamos 2010-12-22  878  
6a504a75 Dimitris Papastamos 2010-12-22  879  static const struct 
snd_kcontrol_new in1r_pga =
6a504a75 Dimitris Papastamos 2010-12-22  880SOC_DAPM_SINGLE(IN1R Switch, 
WM8995_POWER_MANAGEMENT_2, 4, 1, 0);
6a504a75 Dimitris Papastamos 2010-12-22  881  
6a504a75 Dimitris Papastamos 2010-12-22  882  static const char *adc_mux_text[] 
= {
6a504a75 Dimitris Papastamos 2010-12-22  883ADC,
6a504a75 Dimitris Papastamos 2010-12-22  884DMIC,
6a504a75 Dimitris Papastamos 2010-12-22  885  };
6a504a75 Dimitris Papastamos 2010-12-22  886  
b67b9dce Takashi Iwai2014-02-18 @887  static const 
SOC_ENUM_SINGLE_DECL(adc_enum, 0, 0, adc_mux_text);
6a504a75 Dimitris Papastamos 2010-12-22  888  
6a504a75 Dimitris Papastamos 2010-12-22  889  static const struct 
snd_kcontrol_new adcl_mux =
6a504a75 Dimitris Papastamos 2010-12-22  890SOC_DAPM_ENUM_VIRT(ADCL Mux, 
adc_enum);
6a504a75 Dimitris Papastamos 2010-12-22  891  
6a504a75 Dimitris Papastamos 2010-12-22  892  static const struct 
snd_kcontrol_new adcr_mux =
6a504a75 Dimitris Papastamos 2010-12-22  893SOC_DAPM_ENUM_VIRT(ADCR Mux, 
adc_enum);
6a504a75 Dimitris Papastamos 2010-12-22  894  
6a504a75 Dimitris Papastamos 2010-12-22  895  static const char *spk_src_text[] 
= {

---
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] [drdb:for-3.15-p2 40/63] drivers/block/drbd/drbd_req.c:1401 request_timer_fn() warn: inconsistent returns spin_lock:connection-resource-req_lock: locked (1359, 1368) unlocked (1401)

2014-02-20 Thread Dan Carpenter
[ Are device-resource-req_lock and connection-resource-req_lock the
  same lock? ]

Hi Andreas,

FYI, there are new smatch warnings show up in

tree:   git://git.drbd.org/linux-drbd.git for-3.15-p2
head:   2457b6d5ee1a9ff8a3c15ea8eaa5bc195a47d326
commit: 0500813fe0c9a617ace86d91344e36839050dad6 [40/63] drbd: Move conf_mutex 
from connection to resource

drivers/block/drbd/drbd_req.c:1401 request_timer_fn() warn: inconsistent 
returns spin_lock:connection-resource-req_lock: locked (1359, 1368) unlocked 
(1401)
drivers/block/drbd/drbd_req.c:1401 request_timer_fn() warn: inconsistent 
returns spin_lock:device-resource-req_lock: locked (1401) unlocked (1359, 
1368)

git remote add drdb git://git.drbd.org/linux-drbd.git
git remote update drdb
git checkout 0500813fe0c9a617ace86d91344e36839050dad6
vim +1401 drivers/block/drbd/drbd_req.c

ba280c09 Lars Ellenberg  2012-04-25  1385* to expire twice (worst case) 
to become effective. Good enough.
ba280c09 Lars Ellenberg  2012-04-25  1386*/
ba280c09 Lars Ellenberg  2012-04-25  1387   if (ent  req-rq_state  
RQ_NET_PENDING 
ba280c09 Lars Ellenberg  2012-04-25  1388time_after(now, 
req-start_time + ent) 
bde89a9e Andreas Gruenbacher 2011-05-30  1389   !time_in_range(now, 
connection-last_reconnect_jif, connection-last_reconnect_jif + ent)) {
d0180171 Andreas Gruenbacher 2011-07-03  1390   drbd_warn(device, 
Remote failed to finish a request within ko-count * timeout\n);
b30ab791 Andreas Gruenbacher 2011-07-03  1391   
_drbd_set_state(_NS(device, conn, C_TIMEOUT), CS_VERBOSE | CS_HARD, NULL);
7fde2be9 Philipp Reisner 2011-03-01  1392   }
b30ab791 Andreas Gruenbacher 2011-07-03  1393   if (dt  req-rq_state  
RQ_LOCAL_PENDING  req-w.device == device 
ba280c09 Lars Ellenberg  2012-04-25  1394time_after(now, 
req-start_time + dt) 
b30ab791 Andreas Gruenbacher 2011-07-03  1395   !time_in_range(now, 
device-last_reattach_jif, device-last_reattach_jif + dt)) {
d0180171 Andreas Gruenbacher 2011-07-03  1396   drbd_warn(device, 
Local backing device failed to meet the disk-timeout\n);
b30ab791 Andreas Gruenbacher 2011-07-03  1397   
__drbd_chk_io_error(device, DRBD_FORCE_DETACH);
dfa8bedb Philipp Reisner 2011-06-29  1398   }
ba280c09 Lars Ellenberg  2012-04-25  1399   nt = (time_after(now, 
req-start_time + et) ? now : req-start_time) + et;
0500813f Andreas Gruenbacher 2011-07-07  1400   
spin_unlock_irq(connection-resource-req_lock);
b30ab791 Andreas Gruenbacher 2011-07-03 @1401   
mod_timer(device-request_timer, nt);
7fde2be9 Philipp Reisner 2011-03-01  1402  }

---
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] [ext3:for_testing 2/2] fs/udf/file.c:161:4-10: preceding lock on line 147

2014-02-20 Thread Dan Carpenter
Hi Jan,

FYI, there are coccinelle warnings in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 
for_testing
head:   cf8a67a17ee09cd37bccf4d8f82ac20a6e2c2558
commit: cf8a67a17ee09cd37bccf4d8f82ac20a6e2c2558 [2/2] udf: Fix data corruption 
on file type conversion

 fs/udf/file.c:161:4-10: preceding lock on line 147

git remote add ext3 
git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git
git remote update ext3
git checkout cf8a67a17ee09cd37bccf4d8f82ac20a6e2c2558
vim +161 fs/udf/file.c

543ade1fc Badari Pulavarty 2006-09-30  141  struct file *file = 
iocb-ki_filp;
496ad9aa8 Al Viro  2013-01-23  142  struct inode *inode = 
file_inode(file);
^1da177e4 Linus Torvalds   2005-04-16  143  int err, pos;
73a7075e3 Kent Overstreet  2013-05-09  144  size_t count = iocb-ki_nbytes;
48d6d8ff7 Marcin Slusarz   2008-02-08  145  struct udf_inode_info *iinfo = 
UDF_I(inode);
^1da177e4 Linus Torvalds   2005-04-16  146  
cf8a67a17 Jan Kara 2014-02-18 @147  mutex_lock(inode-i_mutex);
8754a3f71 Jan Kara 2010-11-16  148  down_write(iinfo-i_data_sem);
48d6d8ff7 Marcin Slusarz   2008-02-08  149  if (iinfo-i_alloc_type == 
ICBTAG_FLAG_AD_IN_ICB) {
^1da177e4 Linus Torvalds   2005-04-16  150  if (file-f_flags  
O_APPEND)
^1da177e4 Linus Torvalds   2005-04-16  151  pos = 
inode-i_size;
^1da177e4 Linus Torvalds   2005-04-16  152  else
543ade1fc Badari Pulavarty 2006-09-30  153  pos = ppos;
^1da177e4 Linus Torvalds   2005-04-16  154  
4b1ab Marcin Slusarz   2008-02-08  155  if 
(inode-i_sb-s_blocksize 
4b1ab Marcin Slusarz   2008-02-08  156  
(udf_file_entry_alloc_offset(inode) +
28de7948a Cyrill Gorcunov  2007-07-21  157  
pos + count)) {
7e49b6f24 Jan Kara 2010-10-22  158  err = 
udf_expand_file_adinicb(inode);
7e49b6f24 Jan Kara 2010-10-22  159  if (err) {
^1da177e4 Linus Torvalds   2005-04-16  160  
udf_debug(udf_expand_adinicb: err=%d\n, err);
^1da177e4 Linus Torvalds   2005-04-16 @161  return 
err;
^1da177e4 Linus Torvalds   2005-04-16  162  }
cb00ea352 Cyrill Gorcunov  2007-07-19  163  } else {
^1da177e4 Linus Torvalds   2005-04-16  164  if (pos + count 
 inode-i_size)

---
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] [next:master 4169/4893] sound/soc/intel/sst-haswell-ipc.c:553 ipc_tx_message() warn: inconsistent returns irqsave:flags: locked (531 [(-16)]) unlocked (551 [(-110), 0], 553 [0])

2014-02-26 Thread Dan Carpenter
On Wed, Feb 26, 2014 at 06:22:01PM +0800, kbuild test robot wrote:
 sound/soc/intel/sst-haswell-ipc.c:553 ipc_tx_message() warn: inconsistent 
 returns irqsave:flags: locked (531 [(-16)]) unlocked (551 [(-110),0], 553 [0])
 sound/soc/intel/sst-haswell-ipc.c:620 hsw_notification_work() warn: 
 sizoef(pointer)?
 sound/soc/intel/sst-haswell-ipc.c:620 hsw_notification_work() warn: was 
 'sizeof(*pos)' intended?

I fixed these earlier...

 sound/soc/intel/sst-haswell-pcm.c:761 hsw_pcm_probe() error: no modifiers for 
 allocation.
 sound/soc/intel/sst-haswell-pcm.c:768 hsw_pcm_probe() error: no modifiers for 
 allocation.

For some reason Smatch complains about:

priv_data-pcm_pg[i][1] = kzalloc(PAGE_SIZE, GFP_DMA);

When I added the check to Smatch I thought that was invalid but that was
years ago and now I'm not sure if it's valid or not.

regards,
dan carpenter

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


[kbuild] [mmotm:master 64/350] fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 'irqsave:flags'

2014-02-26 Thread Dan Carpenter
[ False positive, this is not a bug, it's just that the second IRQ save
  is unnecessary ].

Hi Jan,

FYI, there are new smatch warnings show up in

tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   a6a1126d3535f0bd8d7c56810061541a4f5595af
commit: c8acdd9e9cf2dd5a5f62034dfaf93c721b3f405d [64/350] ocfs2: avoid blocking 
in ocfs2_mark_lockres_freeing() in downconvert thread

fs/ocfs2/dlmglue.c:3184 ocfs2_mark_lockres_freeing() error: double lock 
'irqsave:flags'
fs/ocfs2/dlmglue.c:3204 ocfs2_mark_lockres_freeing() error: double unlock 
'irqsave:flags'

git remote add mmotm git://git.cmpxchg.org/linux-mmotm.git
git remote update mmotm
git checkout c8acdd9e9cf2dd5a5f62034dfaf93c721b3f405d
vim +3184 fs/ocfs2/dlmglue.c

c8acdd9e Jan Kara2014-02-25  3178* 
ocfs2_clear_inode()
c8acdd9e Jan Kara2014-02-25  3179*   
ocfs2_mark_lockres_freeing()
c8acdd9e Jan Kara2014-02-25  3180* ... blocks 
waiting for OCFS2_LOCK_QUEUED
c8acdd9e Jan Kara2014-02-25  3181* since we are 
the downconvert thread which
c8acdd9e Jan Kara2014-02-25  3182* should clear 
the flag.
c8acdd9e Jan Kara2014-02-25  3183*/
c8acdd9e Jan Kara2014-02-25 @3184   
spin_lock_irqsave(osb-dc_task_lock, flags);
c8acdd9e Jan Kara2014-02-25  3185   
list_del_init(lockres-l_blocked_list);
c8acdd9e Jan Kara2014-02-25  3186   osb-blocked_lock_count--;
c8acdd9e Jan Kara2014-02-25  3187   
spin_unlock_irqrestore(osb-dc_task_lock, flags);
c8acdd9e Jan Kara2014-02-25  3188   lockres_clear_flags(lockres, 
OCFS2_LOCK_QUEUED);
c8acdd9e Jan Kara2014-02-25  3189   goto out_unlock;
c8acdd9e Jan Kara2014-02-25  3190   }
ccd979bd Mark Fasheh 2005-12-15  3191   while (lockres-l_flags  
OCFS2_LOCK_QUEUED) {
ccd979bd Mark Fasheh 2005-12-15  3192   
lockres_add_mask_waiter(lockres, mw, OCFS2_LOCK_QUEUED, 0);
ccd979bd Mark Fasheh 2005-12-15  3193   
spin_unlock_irqrestore(lockres-l_lock, flags);
ccd979bd Mark Fasheh 2005-12-15  3194  
ccd979bd Mark Fasheh 2005-12-15  3195   mlog(0, Waiting on lockres 
%s\n, lockres-l_name);
ccd979bd Mark Fasheh 2005-12-15  3196  
ccd979bd Mark Fasheh 2005-12-15  3197   status = 
ocfs2_wait_for_mask(mw);
ccd979bd Mark Fasheh 2005-12-15  3198   if (status)
ccd979bd Mark Fasheh 2005-12-15  3199   mlog_errno(status);
ccd979bd Mark Fasheh 2005-12-15  3200  
ccd979bd Mark Fasheh 2005-12-15  3201   
spin_lock_irqsave(lockres-l_lock, flags);
ccd979bd Mark Fasheh 2005-12-15  3202   }
c8acdd9e Jan Kara2014-02-25  3203  out_unlock:
ccd979bd Mark Fasheh 2005-12-15 @3204   
spin_unlock_irqrestore(lockres-l_lock, flags);
ccd979bd Mark Fasheh 2005-12-15  3205  }
ccd979bd Mark Fasheh 2005-12-15  3206  
d680efe9 Mark Fasheh 2006-09-08  3207  void ocfs2_simple_drop_lockres(struct 
ocfs2_super *osb,

---
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] [digsig:dm-integrity 1/4] drivers/md/dm-integrity.c:431 dm_int_verify_io() warn: passing the wrong stuff kunmap()

2014-02-26 Thread Dan Carpenter
[ The error message has bad grammar and is confusing.  It means that it
  should be kunmap(bv-bv_page) - dan]

Hi Dmitry,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/kasatkin/linux-digsig.git 
dm-integrity
head:   6fb61adc51796f1379c3b1432340c67d82c794e2
commit: 883e383ea2a3c0c7bdc78f21a6c65ec9b65342ec [1/4] dm-integrity: integrity 
protection device-mapper target

drivers/md/dm-integrity.c:431 dm_int_verify_io() warn: passing the wrong stuff 
kunmap()

git remote add digsig 
git://git.kernel.org/pub/scm/linux/kernel/git/kasatkin/linux-digsig.git
git remote update digsig
git checkout 883e383ea2a3c0c7bdc78f21a6c65ec9b65342ec
vim +431 drivers/md/dm-integrity.c

883e383e Dmitry Kasatkin 2013-10-23  415if (err)
883e383e Dmitry Kasatkin 2013-10-23  416break;
883e383e Dmitry Kasatkin 2013-10-23  417  
883e383e Dmitry Kasatkin 2013-10-23  418err = 
dm_int_calc_hmac(io, offset, digest, sizeof(digest),
883e383e Dmitry Kasatkin 2013-10-23  419   
hmac);
883e383e Dmitry Kasatkin 2013-10-23  420if (err)
883e383e Dmitry Kasatkin 2013-10-23  421break;
883e383e Dmitry Kasatkin 2013-10-23  422  
883e383e Dmitry Kasatkin 2013-10-23  423err = 
dm_int_verify_hmac(io, offset, hmac, bio_data_dir(bio));
883e383e Dmitry Kasatkin 2013-10-23  424if (err) {
883e383e Dmitry Kasatkin 2013-10-23  425if (dmi-flags 
 DM_INT_FLAGS_ZERO) {
883e383e Dmitry Kasatkin 2013-10-23  426void 
*ptr = kmap(bv-bv_page);
883e383e Dmitry Kasatkin 2013-10-23  427if 
(!ptr)
883e383e Dmitry Kasatkin 2013-10-23  428
break;
883e383e Dmitry Kasatkin 2013-10-23  429
DMERR_LIMIT(Ignoring bad HMAC);
883e383e Dmitry Kasatkin 2013-10-23  430
memset(ptr + bv-bv_offset, 0, bv-bv_len);
883e383e Dmitry Kasatkin 2013-10-23 @431
kunmap(ptr);
883e383e Dmitry Kasatkin 2013-10-23  432err = 0;
883e383e Dmitry Kasatkin 2013-10-23  433} else
883e383e Dmitry Kasatkin 2013-10-23  434break;
883e383e Dmitry Kasatkin 2013-10-23  435}
883e383e Dmitry Kasatkin 2013-10-23  436  
883e383e Dmitry Kasatkin 2013-10-23  437offset += bv-bv_len;
883e383e Dmitry Kasatkin 2013-10-23  438size -= bv-bv_len;
883e383e Dmitry Kasatkin 2013-10-23  439}

---
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] [alexshi:single-balance 8/9] kernel/sched/fair.c:7235 new_idle_balance() error: potentially dereferencing uninitialized 'slip'.

2014-02-28 Thread Dan Carpenter
False positive.

regards,
dan carpenter

On Fri, Feb 28, 2014 at 06:07:03PM +0800, kbuild test robot wrote:
 TO: Alex Shi alex@linaro.org
 
 
 Hi Alex,
 
 FYI, there are new smatch warnings show up in
 
 tree:   https://github.com/alexshi/power-scheduling.git single-balance
 head:   243adc32582b0e6acaddf422b9dc0f806c5d04fe
 commit: 56510d2e9a058340794c7152dbfb251171eecc7f [8/9] sched/balance: replace 
 new_idle_balance
 :: branch date: 72 minutes ago
 :: commit date: 72 minutes ago
 
 kernel/sched/fair.c:7235 new_idle_balance() error: potentially dereferencing 
 uninitialized 'slip'.
 
 git remote add alexshi https://github.com/alexshi/power-scheduling.git
 git remote update alexshi
 git checkout 56510d2e9a058340794c7152dbfb251171eecc7f
 vim +/slip +7235 kernel/sched/fair.c
 
 56510d2e Alex Shi 2014-02-28  7219slip = sli;
 56510d2e Alex Shi 2014-02-28  7220slip-sd = sd;
 56510d2e Alex Shi 2014-02-28  7221  
 56510d2e Alex Shi 2014-02-28  7222if (cpu == this_cpu) {
 56510d2e Alex Shi 2014-02-28  7223
 insert_cpuload_tree(slip-unutil, cld);
 56510d2e Alex Shi 2014-02-28  7224continue;
 56510d2e Alex Shi 2014-02-28  7225}
 56510d2e Alex Shi 2014-02-28  7226  
 56510d2e Alex Shi 2014-02-28  7227/* setup under utilization tree 
 */
 56510d2e Alex Shi 2014-02-28  7228if (cld-imb  0  
 cld-cfs_nr_running  1)
 56510d2e Alex Shi 2014-02-28  7229
 insert_cpuload_tree(slip-ovutil, cld);
 56510d2e Alex Shi 2014-02-28  7230  
 56510d2e Alex Shi 2014-02-28  7231}
 56510d2e Alex Shi 2014-02-28  7232  
 56510d2e Alex Shi 2014-02-28  7233pre_imb = cpuld[this_cpu].imb;
 56510d2e Alex Shi 2014-02-28  7234  
 56510d2e Alex Shi 2014-02-28 @7235if (RB_EMPTY_ROOT(slip-unutil)  
 RB_EMPTY_ROOT(slip-ovutil))
 56510d2e Alex Shi 2014-02-28  7236balance_sds(slip, cpus, 
 all_balanced);
 56510d2e Alex Shi 2014-02-28  7237  
 56510d2e Alex Shi 2014-02-28  7238if (single_sd || cpuld[this_cpu].imb  
 pre_imb)
 56510d2e Alex Shi 2014-02-28  7239goto end;
 56510d2e Alex Shi 2014-02-28  7240goto global;
 56510d2e Alex Shi 2014-02-28  7241  end:
 56510d2e Alex Shi 2014-02-28  7242rcu_read_unlock();
 56510d2e Alex Shi 2014-02-28  7243  }
 
 ---
 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: sctp: rework multihoming retransmission path selection to rfc4960

2014-02-28 Thread Dan Carpenter
Hello Daniel Borkmann,

This is a semi-automatic email about new static checker warnings.

The patch 4c47af4d5eb2: net: sctp: rework multihoming retransmission
path selection to rfc4960 from Feb 20, 2014, leads to the following
Smatch complaint:

net/sctp/associola.c:1322 sctp_assoc_update_retran_path()
 warn: variable dereferenced before check 'trans_next' (see line 1319)

net/sctp/associola.c
  1305  /* Iterate from retran_path's successor back to retran_path. */
  1306  for (trans = list_next_entry(trans, transports); 1;
  1307   trans = list_next_entry(trans, transports)) {
  1308  /* Manually skip the head element. */
  1309  if (trans-transports == 
asoc-peer.transport_addr_list)
  1310  continue;
  1311  if (trans-state == SCTP_UNCONFIRMED)
  1312  continue;
  1313  trans_next = sctp_trans_elect_best(trans, trans_next);
  1314  /* Active is good enough for immediate return. */
  1315  if (trans_next-state == SCTP_ACTIVE)
^
Dereference.

  1316  break;
^^
  1317  /* We've reached the end, time to update path. */
  1318  if (trans == asoc-peer.retran_path)
  1319  break;
^
These two breaks are the the only way to exit from the loop.

  1320  }
  1321  
  1322  if (trans_next != NULL)
^^
Check to late.

  1323  asoc-peer.retran_path = trans_next;
  1324  

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


Re: [kbuild] net: add for_each iterators through neighbour lower link's private

2014-02-28 Thread Dan Carpenter
Hello Veaceslav Falico,

This is a semi-automatic email about new static checker warnings.

The patch 31088a113c2a: net: add for_each iterators through 
neighbour lower link's private from Sep 25, 2013, leads to the 
following Smatch complaint:

net/core/dev.c:4566 netdev_lower_get_next_private()
 warn: variable dereferenced before check 'iter' (see line 4561)

net/core/dev.c
  4560  
  4561  lower = list_entry(*iter, struct netdev_adjacent, list);
   ^
Dereference.

  4562  
  4563  if (lower-list == dev-adj_list.lower)
  4564  return NULL;
  4565  
  4566  if (iter)

Check too late.

  4567  *iter = lower-list.next;
  4568  


The RCU version of this function has the same problem.

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


Re: [kbuild] net: sctp: rework multihoming retransmission path selection to rfc4960

2014-03-01 Thread Dan Carpenter
On Sat, Mar 01, 2014 at 12:30:09AM +0100, Daniel Borkmann wrote:
 On 03/01/2014 12:15 AM, Dan Carpenter wrote:
 Hello Daniel Borkmann,
 
 This is a semi-automatic email about new static checker warnings.
 
 The patch 4c47af4d5eb2: net: sctp: rework multihoming retransmission
 path selection to rfc4960 from Feb 20, 2014, leads to the following
 Smatch complaint:
 
 net/sctp/associola.c:1322 sctp_assoc_update_retran_path()
   warn: variable dereferenced before check 'trans_next' (see line 1319)
 
 net/sctp/associola.c
1305  /* Iterate from retran_path's successor back to 
  retran_path. */
1306  for (trans = list_next_entry(trans, transports); 1;
1307   trans = list_next_entry(trans, transports)) {
1308  /* Manually skip the head element. */
1309  if (trans-transports == 
  asoc-peer.transport_addr_list)
1310  continue;
1311  if (trans-state == SCTP_UNCONFIRMED)
1312  continue;
1313  trans_next = sctp_trans_elect_best(trans, 
  trans_next);
1314  /* Active is good enough for immediate return. */
1315  if (trans_next-state == SCTP_ACTIVE)
  ^
 Dereference.
 
 That is a false-positive.
 
 trans_next at that time is being assigned through sctp_trans_elect_best() a
 guaranteed non-NULL pointer.
 

Can you remove the NULL check then?

regards,
dan carpenter

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


[kbuild] [wireless-next:master 171/199] drivers/net/wireless/ath/wil6210/debugfs.c:402 wil_txdesc_debugfs_show() warn: buffer overflow 'wil-vring_tx' 24 = 24

2014-03-01 Thread Dan Carpenter
Hi Vladimir,

FYI, there are new smatch warnings show up in

tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   3e3831c4fdc53aabf3a56419ef6d96a841c52435
commit: 3a85543e9f9f6821d27d33d436f2bad96e5166df [171/199] wil6210: [DEBUG] 
allow to query Rx and all Tx VRING descriptors

drivers/net/wireless/ath/wil6210/debugfs.c:402 wil_txdesc_debugfs_show() warn: 
buffer overflow 'wil-vring_tx' 24 = 24
drivers/net/wireless/ath/wil6210/debugfs.c:402 wil_txdesc_debugfs_show() warn: 
buffer overflow 'wil-vring_tx' 24 = 24

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 3a85543e9f9f6821d27d33d436f2bad96e5166df
vim +402 drivers/net/wireless/ath/wil6210/debugfs.c

2be7d22f Vladimir Kondratiev 2012-12-20  386wil_reset(wil);
2be7d22f Vladimir Kondratiev 2012-12-20  387  
2be7d22f Vladimir Kondratiev 2012-12-20  388return len;
2be7d22f Vladimir Kondratiev 2012-12-20  389  }
2be7d22f Vladimir Kondratiev 2012-12-20  390  
2be7d22f Vladimir Kondratiev 2012-12-20  391  static const struct 
file_operations fops_reset = {
2be7d22f Vladimir Kondratiev 2012-12-20  392.write = wil_write_file_reset,
93ecbd64 Wei Yongjun 2013-02-26  393.open  = simple_open,
2be7d22f Vladimir Kondratiev 2012-12-20  394  };
2be7d22f Vladimir Kondratiev 2012-12-20  395  
3a85543e Vladimir Kondratiev 2014-02-27  396  /*-Tx/Rx 
descriptor*/
2be7d22f Vladimir Kondratiev 2012-12-20  397  static int 
wil_txdesc_debugfs_show(struct seq_file *s, void *data)
2be7d22f Vladimir Kondratiev 2012-12-20  398  {
2be7d22f Vladimir Kondratiev 2012-12-20  399struct wil6210_priv *wil = 
s-private;
3a85543e Vladimir Kondratiev 2014-02-27  400struct vring *vring;
3a85543e Vladimir Kondratiev 2014-02-27  401if (dbg_vring_index = 
WIL6210_MAX_TX_RINGS)
3a85543e Vladimir Kondratiev 2014-02-27 @402vring = 
(wil-vring_tx[dbg_vring_index]);
3a85543e Vladimir Kondratiev 2014-02-27  403else
3a85543e Vladimir Kondratiev 2014-02-27  404vring = wil-vring_rx;
2be7d22f Vladimir Kondratiev 2012-12-20  405  
2be7d22f Vladimir Kondratiev 2012-12-20  406if (!vring-va) {
3a85543e Vladimir Kondratiev 2014-02-27  407if (dbg_vring_index = 
WIL6210_MAX_TX_RINGS)
3a85543e Vladimir Kondratiev 2014-02-27  408seq_printf(s, 
No Tx[%2d] VRING\n, dbg_vring_index);
3a85543e Vladimir Kondratiev 2014-02-27  409else
3a85543e Vladimir Kondratiev 2014-02-27  410seq_puts(s, No 
Rx VRING\n);

---
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] [iio:togreg 3/3] drivers/iio/adc/xilinx-xadc-events.c:252 xadc_write_event_value() warn: inconsistent returns mutex:xadc-mutex: locked (218 [(-22)]) unlocked (206 [(-22)], 252 [s32min-s32ma

2014-03-01 Thread Dan Carpenter
Hi Lars-Peter,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
head:   0f97ca5cebaede963ccbfc986b7bf5a57c37ee7c
commit: 0f97ca5cebaede963ccbfc986b7bf5a57c37ee7c [3/3] iio:adc: Add Xilinx XADC 
driver

drivers/iio/adc/xilinx-xadc-events.c:252 xadc_write_event_value() warn: 
inconsistent returns mutex:xadc-mutex: locked (218 [(-22)]) unlocked (206 
[(-22)], 252 [s32min-s32max], 252 [0], 252 [s32min-(-1),1-s32max])

git remote add iio git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git remote update iio
git checkout 0f97ca5cebaede963ccbfc986b7bf5a57c37ee7c
vim +252 drivers/iio/adc/xilinx-xadc-events.c

0f97ca5c Lars-Peter Clausen 2014-02-17  236 
xadc-threshold[offset + 4] = 0;
0f97ca5c Lars-Peter Clausen 2014-02-17  237 else
0f97ca5c Lars-Peter Clausen 2014-02-17  238 
xadc-threshold[offset + 4] = xadc-threshold[offset] -
0f97ca5c Lars-Peter Clausen 2014-02-17  239 
xadc-temp_hysteresis;
0f97ca5c Lars-Peter Clausen 2014-02-17  240 ret = 
_xadc_write_adc_reg(xadc, XADC_REG_THRESHOLD(offset + 4),
0f97ca5c Lars-Peter Clausen 2014-02-17  241 
xadc-threshold[offset + 4]);
0f97ca5c Lars-Peter Clausen 2014-02-17  242 if (ret)
0f97ca5c Lars-Peter Clausen 2014-02-17  243 goto out_unlock;
0f97ca5c Lars-Peter Clausen 2014-02-17  244 }
0f97ca5c Lars-Peter Clausen 2014-02-17  245  
0f97ca5c Lars-Peter Clausen 2014-02-17  246 if (info == IIO_EV_INFO_VALUE)
0f97ca5c Lars-Peter Clausen 2014-02-17  247 ret = 
_xadc_write_adc_reg(xadc, XADC_REG_THRESHOLD(offset), val);
0f97ca5c Lars-Peter Clausen 2014-02-17  248  
0f97ca5c Lars-Peter Clausen 2014-02-17  249  out_unlock:
0f97ca5c Lars-Peter Clausen 2014-02-17  250 mutex_unlock(xadc-mutex);
0f97ca5c Lars-Peter Clausen 2014-02-17  251  
0f97ca5c Lars-Peter Clausen 2014-02-17 @252 return ret;
0f97ca5c Lars-Peter Clausen 2014-02-17  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] [omap-dss2:for-next 16/27] drivers/video/fbdev/s3fb.c:1406 s3_pci_remove() warn: variable dereferenced before check 'info' (see line 1404)

2014-03-03 Thread Dan Carpenter
This commit is very old 2011-04-20.

regards,
dan carpenter

On Mon, Mar 03, 2014 at 05:39:52PM +0800, kbuild test robot wrote:
 TO: Tomi Valkeinen tomi.valkei...@ti.com
 
 
 Hi Tomi,
 
 FYI, there are new smatch warnings show up in
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git for-next
 head:   2b04f21e69a186f645dc543aa3c90a72ffb946a0
 commit: 08667731d1d4105296ee760eb2b8b6ca162bb0f8 [16/27] video: move fbdev to 
 drivers/video/fbdev
 config: make ARCH=i386 allyesconfig
 :: branch date: 74 minutes ago
 :: commit date: 3 days ago
 
 All warnings:
 
drivers/video/fbdev/vt8623fb.c: In function 'vt8623_pci_probe':
  drivers/video/fbdev/vt8623fb.c:734:23: warning: cast to pointer from 
  integer of different size [-Wint-to-pointer-cast]
  par-state.vgabase = (void __iomem *) vga_res.start;
   ^
 --
drivers/video/fbdev/s3fb.c: In function 's3_pci_probe':
  drivers/video/fbdev/s3fb.c:1185:23: warning: cast to pointer from integer 
  of different size [-Wint-to-pointer-cast]
  par-state.vgabase = (void __iomem *) vga_res.start;
   ^
 --
drivers/video/fbdev/arkfb.c: In function 'ark_pci_probe':
  drivers/video/fbdev/arkfb.c:1019:23: warning: cast to pointer from integer 
  of different size [-Wint-to-pointer-cast]
  par-state.vgabase = (void __iomem *) vga_res.start;
   ^
 drivers/video/fbdev/s3fb.c:1406 s3_pci_remove() warn: variable dereferenced 
 before check 'info' (see line 1404)
 drivers/video/fbdev/arkfb.c:454 ics5342_init() warn: struct type mismatch 
 'dac_info vs ics5342_info'
 drivers/video/fbdev/hgafb.c:420 hgafb_pan_display() warn: unsigned 
 'var-yoffset' is never less than zero.
 drivers/video/fbdev/udlfb.c:1498 dlfb_select_std_channel() error: doing dma 
 on the stack (set_def_chn)
 drivers/video/fbdev/uvesafb.c:1509 uvesafb_init_info() error: we previously 
 assumed 'mode' could be null (see line 1477)
 drivers/video/fbdev/uvesafb.c:1815 uvesafb_remove() warn: variable 
 dereferenced before check 'par' (see line 1810)
 drivers/video/fbdev/mb862xx/mb862xxfb_accel.c:248 mb86290fb_imageblit() 
 error: no modifiers for allocation.
 drivers/video/fbdev/matrox/matroxfb_base.c:1974 matroxfb_register_device() 
 error: we previously assumed 'drv' could be null (see line 1975)
 drivers/video/fbdev/matrox/matroxfb_base.c:2032 matroxfb_probe() warn: 
 returning -1 instead of -ENOMEM is sloppy
 drivers/video/fbdev/riva/fbdev.c:1120 rivafb_check_var() warn: missing break? 
 reassigning 'var-green.length'
 drivers/video/fbdev/matrox/matroxfb_Ti3026.c:375 Ti3026_init() error: 
 __builtin_memcpy() 'MGADACbpp32' too small (21 vs 80)
 drivers/video/fbdev/sis/sis_main.c:1576 sisfb_check_var() warn: unsigned 
 'var-xoffset' is never less than zero.
 drivers/video/fbdev/sis/sis_main.c:1577 sisfb_check_var() warn: unsigned 
 'var-yoffset' is never less than zero.
 drivers/video/fbdev/sis/sis_main.c:4433 sisfb_post_sis300() error: we 
 previously assumed 'bios' could be null (see line 4418)
 drivers/video/fbdev/sis/sis_main.c:4809 sisfb_post_xgi_ramsize() error: 
 buffer overflow 'dramsr13_4' 20 = 59
 drivers/video/fbdev/sis/sis_main.c:4814 sisfb_post_xgi_ramsize() error: 
 buffer overflow 'dramsr13_4' 20 = 58
 drivers/video/fbdev/via/viafbdev.c:866 viafb_cursor() error: buffer overflow 
 'cr_data-bak' 2048 = 2048
 drivers/video/fbdev/via/viafbdev.c:872 viafb_cursor() error: buffer overflow 
 'cr_data-bak' 2048 = 2048
 drivers/video/fbdev/via/viafbdev.c:873 viafb_cursor() error: buffer overflow 
 'cr_data-bak' 2048 = 2049
 drivers/video/fbdev/via/viafbdev.c:874 viafb_cursor() error: buffer overflow 
 'cr_data-bak' 2048 = 2050
 drivers/video/fbdev/sis/init.c:656 SiS_GetModeID_LCD() warn: missing break? 
 reassigning 'ModeIndex'
 drivers/video/fbdev/sis/init.c:996 SiSRegInit() warn: the 'SIS_CRT2_PORT_04' 
 macro might need parens
 drivers/video/fbdev/sis/init.c:997 SiSRegInit() warn: the 'SIS_CRT2_PORT_10' 
 macro might need parens
 drivers/video/fbdev/sis/init.c:998 SiSRegInit() warn: the 'SIS_CRT2_PORT_12' 
 macro might need parens
 drivers/video/fbdev/sis/init.c:999 SiSRegInit() warn: the 'SIS_CRT2_PORT_14' 
 macro might need parens
 drivers/video/fbdev/sis/init.c:1000 SiSRegInit() warn: the 'SIS_CRT2_PORT_14' 
 macro might need parens
 drivers/video/fbdev/sis/init.c:1002 SiSRegInit() warn: the 
 'SIS_VIDEO_CAPTURE' macro might need parens
 drivers/video/fbdev/sis/init.c:1003 SiSRegInit() warn: the 
 'SIS_VIDEO_PLAYBACK' macro might need parens
 drivers/video/fbdev/aty/radeon_base.c:1091 radeon_setcolreg() error: buffer 
 overflow 'rinfo-palette' 256 = 510
 drivers/video/fbdev/matrox/matroxfb_crtc2.c:440 matroxfb_dh_ioctl() warn: 
 check that 'vblank.hcount' doesn't leak information
 drivers/video/fbdev/aty/aty128fb.c:2279 aty128fb_setcolreg() error: buffer 
 overflow 'par-green' 64 = 255
 drivers/video/fbdev/aty/aty128fb.c:2286 aty128fb_setcolreg() error: buffer 
 overflow 'par-red' 32

[kbuild] [thermal:next 2/11] drivers/thermal/thermal_core.c:90 thermal_register_governor() error: strncmp() 'step_wise' too small (10 vs 20)

2014-03-03 Thread Dan Carpenter
Obviously, this isn't a bug.  This warning message is printed using a
two step process.  The first step makes a list of functions where one
parameter is the buffer and one parameter is the size.  The second step
prints a warning if we call one of those functions with a buffer which
is smaller than the size.

This test is useful for copy_to_user() or something like that where
reading beyond the end of the array is a security problem.

Often when people call strncmp() with a string literal, it means that
they haven't thought very hard about how strcmp() and strncmp() work.
In this case though the string literal is a define so using strncmp()
makes sense, I suppose.

It's unlikely that using strncmp() with a larger than possible limit
will cause a bug so I will add strncmp() to the list of ignored
functions smatch_data/kernel.sizeof_param.remove

regards,
dan carpenter

-
Hi Zhang,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git next
head:   e79ca84d62d289b90cb39c80df83acf9f315a25c
commit: 635a1f41a8f95a35d1bf24c9cc018ffb018a93e6 [2/11] Thermal: thermal zone 
governor fix

drivers/thermal/thermal_core.c:90 thermal_register_governor() error: strncmp() 
'step_wise' too small (10 vs 20)

git remote add thermal 
git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux.git
git remote update thermal
git checkout 635a1f41a8f95a35d1bf24c9cc018ffb018a93e6
vim +90 drivers/thermal/thermal_core.c

a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  74  
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  75  int 
thermal_register_governor(struct thermal_governor *governor)
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  76  {
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  77 int err;
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  78 const 
char *name;
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  79 struct 
thermal_zone_device *pos;
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  80  
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  81 if 
(!governor)
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  82 
return -EINVAL;
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  83  
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  84 
mutex_lock(thermal_governor_lock);
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  85  
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  86 err = 
-EBUSY;
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  87 if 
(__find_governor(governor-name) == NULL) {
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  88 
err = 0;
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  89 
list_add(governor-governor_list, thermal_governor_list);
635a1f41a drivers/thermal/thermal_core.c Zhang Rui   2014-01-24 @90 
if (!def_governor  !strncmp(governor-name,
635a1f41a drivers/thermal/thermal_core.c Zhang Rui   2014-01-24  91 
DEFAULT_THERMAL_GOVERNOR, THERMAL_NAME_LENGTH))
635a1f41a drivers/thermal/thermal_core.c Zhang Rui   2014-01-24  92 
def_governor = governor;
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  93 }
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  94  
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  95 
mutex_lock(thermal_list_lock);
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  96  
a4a15485f drivers/thermal/thermal_sys.c  Durgadoss R 2012-09-18  97 
list_for_each_entry(pos, thermal_tz_list, node) {
635a1f41a drivers/thermal/thermal_core.c Zhang Rui   2014-01-24  98 
/*

---
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] [mmc:mmc-next 26/64] drivers/mmc/host/rtsx_pci_sdmmc.c:504:6-11: ERROR: cmd is NULL but dereferenced.

2014-03-03 Thread Dan Carpenter
Hi Micky,

FYI, there are coccinelle warnings in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git mmc-next
head:   370aede6a18a41e01f2668108d847b598443fbc0
commit: c42deffd5b53c9e583d83c7964854ede2f12410d [26/64] mmc: rtsx: add support 
for pre_req and post_req

 drivers/mmc/host/rtsx_pci_sdmmc.c:504:6-11: ERROR: cmd is NULL but 
 dereferenced.

git remote add mmc git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc.git
git remote update mmc
git checkout c42deffd5b53c9e583d83c7964854ede2f12410d
vim +504 drivers/mmc/host/rtsx_pci_sdmmc.c

c42deffd Micky Ching 2014-02-17  488if (cmd == host-mrq-sbc) {
c42deffd Micky Ching 2014-02-17  489sd_send_cmd(host, 
host-mrq-cmd);
c42deffd Micky Ching 2014-02-17  490
spin_unlock_irqrestore(host-lock, flags);
c42deffd Micky Ching 2014-02-17  491return;
c42deffd Micky Ching 2014-02-17  492}
c42deffd Micky Ching 2014-02-17  493  
c42deffd Micky Ching 2014-02-17  494if (cmd == host-mrq-stop)
c42deffd Micky Ching 2014-02-17  495goto out;
c42deffd Micky Ching 2014-02-17  496  
c42deffd Micky Ching 2014-02-17  497if (cmd-data) {
c42deffd Micky Ching 2014-02-17  498sd_start_multi_rw(host, 
host-mrq);
c42deffd Micky Ching 2014-02-17  499
spin_unlock_irqrestore(host-lock, flags);
c42deffd Micky Ching 2014-02-17  500return;
c42deffd Micky Ching 2014-02-17  501}
c42deffd Micky Ching 2014-02-17  502  
ff984e57 Wei WANG2012-10-29  503  out:
ff984e57 Wei WANG2012-10-29 @504cmd-error = err;
1b8055b4 Wei WANG2013-08-21  505  
c42deffd Micky Ching 2014-02-17  506tasklet_schedule(host-finish_tasklet);
c42deffd Micky Ching 2014-02-17  507spin_unlock_irqrestore(host-lock, 
flags);
c42deffd Micky Ching 2014-02-17  508  }
c42deffd Micky Ching 2014-02-17  509  
c42deffd Micky Ching 2014-02-17  510  static int sd_pre_dma_transfer(struct 
realtek_pci_sdmmc *host,
c42deffd Micky Ching 2014-02-17  511struct mmc_data *data, 
struct realtek_next *next)
c42deffd Micky Ching 2014-02-17  512  {

---
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] [wireless-next:master 217/219] drivers/net/wireless/rtlwifi/rtl8723be/fw.c:208 _rtl8723be_fill_h2c_command() warn: variable dereferenced before check 'rtlhal' (see line 69)

2014-03-05 Thread Dan Carpenter
Hi Larry,

FYI, there are new smatch warnings show up in

tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   997bc71a3601b25dbbe3ac75b77b4f49582c0ae5
commit: a619d1abe20cc892ddd8f6f60345b24d43971fb4 [217/219] rtlwifi: rtl8723be: 
Add new driver

drivers/net/wireless/rtlwifi/rtl8723be/fw.c:208 _rtl8723be_fill_h2c_command() 
warn: variable dereferenced before check 'rtlhal' (see line 69)
drivers/net/wireless/rtlwifi/rtl8723be/hw.c:1732 _rtl8723be_read_adapter_info() 
error: __builtin_memcpy() 'rtlefuse-efuse_map[0][0]' too small (256 vs 512)

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 a619d1abe20cc892ddd8f6f60345b24d43971fb4
vim +/rtlhal +208 drivers/net/wireless/rtlwifi/rtl8723be/fw.c

a619d1ab Larry Finger 2014-02-28   63   u8 idx;
a619d1ab Larry Finger 2014-02-28   64  
a619d1ab Larry Finger 2014-02-28   65   RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD, 
come in\n);
a619d1ab Larry Finger 2014-02-28   66  
a619d1ab Larry Finger 2014-02-28   67   while (true) {
a619d1ab Larry Finger 2014-02-28   68   
spin_lock_irqsave(rtlpriv-locks.h2c_lock, flag);
a619d1ab Larry Finger 2014-02-28  @69   if (rtlhal-h2c_setinprogress) {
a619d1ab Larry Finger 2014-02-28   70   RT_TRACE(rtlpriv, 
COMP_CMD, DBG_LOUD,
a619d1ab Larry Finger 2014-02-28   71H2C set in 
progress! Wait to set..
a619d1ab Larry Finger 2014-02-28   72
element_id(%d).\n, element_id);
a619d1ab Larry Finger 2014-02-28   73  
a619d1ab Larry Finger 2014-02-28   74   while 
(rtlhal-h2c_setinprogress) {
a619d1ab Larry Finger 2014-02-28   75   
spin_unlock_irqrestore(rtlpriv-locks.h2c_lock,
a619d1ab Larry Finger 2014-02-28   76   
   flag);
a619d1ab Larry Finger 2014-02-28   77   
h2c_waitcounter++;
a619d1ab Larry Finger 2014-02-28   78   
RT_TRACE(rtlpriv, COMP_CMD, DBG_LOUD,
a619d1ab Larry Finger 2014-02-28   79Wait 
100 us (%d times)...\n,
a619d1ab Larry Finger 2014-02-28   80
h2c_waitcounter);
a619d1ab Larry Finger 2014-02-28   81   udelay(100);
a619d1ab Larry Finger 2014-02-28   82  
a619d1ab Larry Finger 2014-02-28   83   if 
(h2c_waitcounter  1000)
a619d1ab Larry Finger 2014-02-28   84   return;
a619d1ab Larry Finger 2014-02-28   85   
spin_lock_irqsave(rtlpriv-locks.h2c_lock,
a619d1ab Larry Finger 2014-02-28   86   
  flag);
a619d1ab Larry Finger 2014-02-28   87   }
a619d1ab Larry Finger 2014-02-28   88   
spin_unlock_irqrestore(rtlpriv-locks.h2c_lock, flag);
a619d1ab Larry Finger 2014-02-28   89   } else {
a619d1ab Larry Finger 2014-02-28   90   
rtlhal-h2c_setinprogress = true;
a619d1ab Larry Finger 2014-02-28   91   
spin_unlock_irqrestore(rtlpriv-locks.h2c_lock, flag);
a619d1ab Larry Finger 2014-02-28   92   break;
a619d1ab Larry Finger 2014-02-28   93   }
a619d1ab Larry Finger 2014-02-28   94   }
a619d1ab Larry Finger 2014-02-28   95   while (!bwrite_sucess) {
a619d1ab Larry Finger 2014-02-28   96   wait_writeh2c_limit--;
a619d1ab Larry Finger 2014-02-28   97   if (wait_writeh2c_limit == 0) {
a619d1ab Larry Finger 2014-02-28   98   RT_TRACE(rtlpriv, 
COMP_ERR, DBG_EMERG,
a619d1ab Larry Finger 2014-02-28   99Write H2C 
fail because no trigger 
a619d1ab Larry Finger 2014-02-28  100for FW 
INT!\n);
a619d1ab Larry Finger 2014-02-28  101   break;
a619d1ab Larry Finger 2014-02-28  102   }
a619d1ab Larry Finger 2014-02-28  103   boxnum = rtlhal-last_hmeboxnum;
a619d1ab Larry Finger 2014-02-28  104   switch (boxnum) {
a619d1ab Larry Finger 2014-02-28  105   case 0:
a619d1ab Larry Finger 2014-02-28  106   box_reg = REG_HMEBOX_0;
a619d1ab Larry Finger 2014-02-28  107   box_extreg = 
REG_HMEBOX_EXT_0;
a619d1ab Larry Finger 2014-02-28  108   break;
a619d1ab Larry Finger 2014-02-28  109   case 1:
a619d1ab Larry Finger 2014-02-28  110   box_reg = REG_HMEBOX_1;
a619d1ab Larry Finger 2014-02-28  111   box_extreg = 
REG_HMEBOX_EXT_1;
a619d1ab Larry Finger 2014-02-28  112   break;
a619d1ab Larry Finger 2014-02-28  113   case 2:
a619d1ab Larry Finger 2014-02-28  114   box_reg = REG_HMEBOX_2;
a619d1ab Larry Finger 2014-02-28  115   box_extreg = 
REG_HMEBOX_EXT_2;
a619d1ab Larry Finger 2014-02-28  116   break;

[kbuild] [linuxtv-media:master 463/499] drivers/media/dvb-frontends/drx39xyj/drxj.c:20803 drx_ctrl_u_code() warn: variable dereferenced before check 'mc_info' (see line 20800)

2014-03-05 Thread Dan Carpenter
Hi Mauro,

FYI, there are new smatch warnings show up in

tree:   git://linuxtv.org/media_tree.git master
head:   59432be1c7fbf2a4f608850855ff649bee0f7b3b
commit: b240eacdd536bac23c9d48dfc3d527ed6870ddad [463/499] [media] drx-j: get 
rid of drx_driver.c

New smatch warnings:
drivers/media/dvb-frontends/drx39xyj/drxj.c:20803 drx_ctrl_u_code() warn: 
variable dereferenced before check 'mc_info' (see line 20800)

Old smatch warnings:
drivers/media/dvb-frontends/drx39xyj/drxj.c:1218 mult32() warn: missing break? 
reassigning '*h'

git remote add linuxtv-media git://linuxtv.org/media_tree.git
git remote update linuxtv-media
git checkout b240eacdd536bac23c9d48dfc3d527ed6870ddad
vim +/mc_info +20803 drivers/media/dvb-frontends/drx39xyj/drxj.c

b240eacd Mauro Carvalho Chehab 2014-01-24  20794u16 i = 0;
b240eacd Mauro Carvalho Chehab 2014-01-24  20795u16 mc_nr_of_blks = 0;
b240eacd Mauro Carvalho Chehab 2014-01-24  20796u16 mc_magic_word = 0;
b240eacd Mauro Carvalho Chehab 2014-01-24  20797const u8 *mc_data_init 
= NULL;
b240eacd Mauro Carvalho Chehab 2014-01-24  20798u8 *mc_data = NULL;
b240eacd Mauro Carvalho Chehab 2014-01-24  20799unsigned size;
b240eacd Mauro Carvalho Chehab 2014-01-24 @20800char *mc_file = 
mc_info-mc_file;
b240eacd Mauro Carvalho Chehab 2014-01-24  20801  
b240eacd Mauro Carvalho Chehab 2014-01-24  20802/* Check arguments */
b240eacd Mauro Carvalho Chehab 2014-01-24 @20803if (!mc_info || 
!mc_file)
b240eacd Mauro Carvalho Chehab 2014-01-24  20804return -EINVAL;
b240eacd Mauro Carvalho Chehab 2014-01-24  20805  
b240eacd Mauro Carvalho Chehab 2014-01-24  20806if (!demod-firmware) {

---
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] [linuxtv-media:master 441/499] drivers/media/dvb-frontends/drx39xyj/drxj.c:16798:68: sparse: dubious: x !y

2014-03-05 Thread Dan Carpenter
These are all boolean variables so the result is the same except that
maybe | and  are faster than || and  because they don't have the
same ordering requirements?

regards,
dan carpenter

On Wed, Mar 05, 2014 at 07:40:53AM +0800, kbuild test robot wrote:
 TO: Mauro Carvalho Chehab m.che...@samsung.com
 CC: linux-me...@vger.kernel.org
 
 
 Hi Mauro,
 
 FYI, there are new sparse warnings show up in
 
 tree:   git://linuxtv.org/media_tree.git master
 head:   59432be1c7fbf2a4f608850855ff649bee0f7b3b
 commit: 259f380e6828c1dd324d43b16c0c95d34f33b4aa [441/499] [media] drx-j: 
 Simplify logic expressions
 reproduce: make C=1 CF=-D__CHECK_ENDIAN__
 :: branch date: 6 hours ago
 :: commit date: 6 hours ago
 
drivers/media/dvb-frontends/drx39xyj/drxj.c:593:6: sparse: symbol 
 'drx_dap_drxj_module_name' was not declared. Should it be static?
drivers/media/dvb-frontends/drx39xyj/drxj.c:594:6: sparse: symbol 
 'drx_dap_drxj_version_text' was not declared. Should it be static?
drivers/media/dvb-frontends/drx39xyj/drxj.c:596:20: sparse: symbol 
 'drx_dap_drxj_version' was not declared. Should it be static?
drivers/media/dvb-frontends/drx39xyj/drxj.c:981:21: sparse: symbol 
 'drxj_default_aud_data_g' was not declared. Should it be static?
  drivers/media/dvb-frontends/drx39xyj/drxj.c:16798:68: sparse: dubious: x  
  !y
  drivers/media/dvb-frontends/drx39xyj/drxj.c:16816:68: sparse: dubious: x  
  !y
  drivers/media/dvb-frontends/drx39xyj/drxj.c:16835:68: sparse: dubious: x  
  !y
drivers/media/dvb-frontends/drx39xyj/drxj.c:14053:27: sparse: cast 
 truncates bits from constant value (00ff becomes ff)
drivers/media/dvb-frontends/drx39xyj/drxj.c:14078:24: sparse: cast 
 truncates bits from constant value (3fff becomes 3fff)
drivers/media/dvb-frontends/drx39xyj/drxj.c:15145:31: sparse: cast 
 truncates bits from constant value (00ff becomes ff)
drivers/media/dvb-frontends/drx39xyj/drxj.c:15195:26: sparse: cast 
 truncates bits from constant value ( becomes 0)
drivers/media/dvb-frontends/drx39xyj/drxj.c:15273:33: sparse: cast 
 truncates bits from constant value (7fff becomes 7fff)
drivers/media/dvb-frontends/drx39xyj/drxj.c:15900:26: sparse: cast 
 truncates bits from constant value (7fff becomes 7fff)
 
 git remote add linuxtv-media git://linuxtv.org/media_tree.git
 git remote update linuxtv-media
 git checkout 259f380e6828c1dd324d43b16c0c95d34f33b4aa
 vim +16798 drivers/media/dvb-frontends/drx39xyj/drxj.c
 
 57afe2f0 Mauro Carvalho Chehab 2014-01-16  16792  scu_cmd.parameter_len = 
 3;
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16793  /* 1-data 
 rate;2-frequency */
 57afe2f0 Mauro Carvalho Chehab 2014-01-16  16794  switch 
 (oob_param-standard) {
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16795  case DRX_OOB_MODE_A:
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16796  if (
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16797 /* 
 signal is transmitted inverted */
 57afe2f0 Mauro Carvalho Chehab 2014-01-16 @16798 
 ((oob_param-spectrum_inverted == true) 
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16799  /* 
 and tuner is not mirroring the signal */
 259f380e Mauro Carvalho Chehab 2014-01-17  16800  
 (!mirror_freq_spectOOB)) |
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16801 /* 
 or */
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16802 /* 
 signal is transmitted noninverted */
 57afe2f0 Mauro Carvalho Chehab 2014-01-16  16803 
 ((oob_param-spectrum_inverted == false) 
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16804  /* 
 and tuner is mirroring the signal */
 259f380e Mauro Carvalho Chehab 2014-01-17  16805  
 (mirror_freq_spectOOB))
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16806  )
 57afe2f0 Mauro Carvalho Chehab 2014-01-16  16807  
 set_param_parameters[0] =
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16808  
 SCU_RAM_ORX_RF_RX_DATA_RATE_2048KBPS_INVSPEC;
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16809  else
 57afe2f0 Mauro Carvalho Chehab 2014-01-16  16810  
 set_param_parameters[0] =
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16811  
 SCU_RAM_ORX_RF_RX_DATA_RATE_2048KBPS_REGSPEC;
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16812  break;
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16813  case 
 DRX_OOB_MODE_B_GRADE_A:
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16814  if (
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16815 /* 
 signal is transmitted inverted */
 57afe2f0 Mauro Carvalho Chehab 2014-01-16 @16816 
 ((oob_param-spectrum_inverted == true) 
 443f18d0 Mauro Carvalho Chehab 2012-03-20  16817

[kbuild] [wireless-next:master 217/219] drivers/net/wireless/rtlwifi/rtl8723be/sw.c:374:14: sparse: duplicate const

2014-03-05 Thread Dan Carpenter
Hi Larry,

FYI, there are new sparse warnings show up in

tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   997bc71a3601b25dbbe3ac75b77b4f49582c0ae5
commit: a619d1abe20cc892ddd8f6f60345b24d43971fb4 [217/219] rtlwifi: rtl8723be: 
Add new driver
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

 drivers/net/wireless/rtlwifi/rtl8723be/sw.c:374:14: sparse: duplicate const 
--
 drivers/net/wireless/rtlwifi/rtl8723be/hw.c:2214:30: sparse: cast to 
 restricted __le32

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 a619d1abe20cc892ddd8f6f60345b24d43971fb4
vim +374 drivers/net/wireless/rtlwifi/rtl8723be/sw.c

a619d1ab Larry Finger 2014-02-28  358  MODULE_AUTHOR(PageHe
page...@realsil.com.cn);
a619d1ab Larry Finger 2014-02-28  359  MODULE_AUTHOR(Realtek WlanFAE   
wlan...@realtek.com);
a619d1ab Larry Finger 2014-02-28  360  MODULE_LICENSE(GPL);
a619d1ab Larry Finger 2014-02-28  361  MODULE_DESCRIPTION(Realtek 8723BE 
802.11n PCI wireless);
a619d1ab Larry Finger 2014-02-28  362  
MODULE_FIRMWARE(rtlwifi/rtl8723befw.bin);
a619d1ab Larry Finger 2014-02-28  363  
a619d1ab Larry Finger 2014-02-28  364  module_param_named(swenc, 
rtl8723be_mod_params.sw_crypto, bool, 0444);
a619d1ab Larry Finger 2014-02-28  365  module_param_named(debug, 
rtl8723be_mod_params.debug, int, 0444);
a619d1ab Larry Finger 2014-02-28  366  module_param_named(ips, 
rtl8723be_mod_params.inactiveps, bool, 0444);
a619d1ab Larry Finger 2014-02-28  367  module_param_named(swlps, 
rtl8723be_mod_params.swctrl_lps, bool, 0444);
a619d1ab Larry Finger 2014-02-28  368  module_param_named(fwlps, 
rtl8723be_mod_params.fwctrl_lps, bool, 0444);
a619d1ab Larry Finger 2014-02-28  369  MODULE_PARM_DESC(swenc, using hardware 
crypto (default 0 [hardware])\n);
a619d1ab Larry Finger 2014-02-28  370  MODULE_PARM_DESC(ips, using no link 
power save (default 1 is open)\n);
a619d1ab Larry Finger 2014-02-28  371  MODULE_PARM_DESC(fwlps, using linked fw 
control power save (default 1 is open)\n);
a619d1ab Larry Finger 2014-02-28  372  MODULE_PARM_DESC(debug, Set debug level 
(0-5) (default 0));
a619d1ab Larry Finger 2014-02-28  373  
a619d1ab Larry Finger 2014-02-28 @374  static const 
SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
a619d1ab Larry Finger 2014-02-28  375  
a619d1ab Larry Finger 2014-02-28  376  static struct pci_driver 
rtl8723be_driver = {
a619d1ab Larry Finger 2014-02-28  377   .name = KBUILD_MODNAME,
a619d1ab Larry Finger 2014-02-28  378   .id_table = rtl8723be_pci_id,
a619d1ab Larry Finger 2014-02-28  379   .probe = rtl_pci_probe,
a619d1ab Larry Finger 2014-02-28  380   .remove = rtl_pci_disconnect,
a619d1ab Larry Finger 2014-02-28  381  
a619d1ab Larry Finger 2014-02-28  382   .driver.pm = rtlwifi_pm_ops,

---
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] [linuxtv-media:master 467/499] drivers/media/dvb-frontends/drx39xyj/drxj.c:20041 drxj_close() warn: variable dereferenced before check 'demod' (see line 20036)

2014-03-05 Thread Dan Carpenter
Hi Mauro,

FYI, there are new smatch warnings show up in

tree:   git://linuxtv.org/media_tree.git master
head:   59432be1c7fbf2a4f608850855ff649bee0f7b3b
commit: b78359a6894ac3451bec3fde5d0499fba87b8b67 [467/499] [media] drx-j: get 
rid of the remaining drx generic functions

New smatch warnings:
drivers/media/dvb-frontends/drx39xyj/drxj.c:20041 drxj_close() warn: variable 
dereferenced before check 'demod' (see line 20036)

Old smatch warnings:
drivers/media/dvb-frontends/drx39xyj/drxj.c:1145 mult32() warn: missing break? 
reassigning '*h'
drivers/media/dvb-frontends/drx39xyj/drxj.c:20435 drx_ctrl_u_code() warn: 
variable dereferenced before check 'mc_info' (see line 20432)

git remote add linuxtv-media git://linuxtv.org/media_tree.git
git remote update linuxtv-media
git checkout b78359a6894ac3451bec3fde5d0499fba87b8b67
vim +/demod +20041 drivers/media/dvb-frontends/drx39xyj/drxj.c

38b2df95 Devin Heitmueller 2012-08-13  20030  * \brief Close the demod 
instance, power down the device
38b2df95 Devin Heitmueller 2012-08-13  20031  * \return Status_t Return 
status.
38b2df95 Devin Heitmueller 2012-08-13  20032  *
38b2df95 Devin Heitmueller 2012-08-13  20033  */
1bfc9e15 Mauro Carvalho Chehab 2014-01-16  20034  int drxj_close(struct 
drx_demod_instance *demod)
38b2df95 Devin Heitmueller 2012-08-13  20035  {
4d7bb0eb Mauro Carvalho Chehab 2014-01-16 @20036struct i2c_device_addr 
*dev_addr = demod-my_i2c_dev_addr;
1bfc9e15 Mauro Carvalho Chehab 2014-01-16  20037struct drx_common_attr 
*common_attr = demod-my_common_attr;
068e94ea Mauro Carvalho Chehab 2014-01-16  20038int rc;
1bfc9e15 Mauro Carvalho Chehab 2014-01-16  20039enum drx_power_mode 
power_mode = DRX_POWER_UP;
38b2df95 Devin Heitmueller 2012-08-13  20040  
b78359a6 Mauro Carvalho Chehab 2014-01-24 @20041if ((demod == NULL) ||
b78359a6 Mauro Carvalho Chehab 2014-01-24  20042
(demod-my_common_attr == NULL) ||
b78359a6 Mauro Carvalho Chehab 2014-01-24  20043(demod-my_ext_attr 
== NULL) ||
b78359a6 Mauro Carvalho Chehab 2014-01-24  20044
(demod-my_i2c_dev_addr == NULL) ||

---
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] [l2-mtd:master 32/43] drivers/mtd/nand/nand_base.c:3178:36-63: duplicated argument to or ||

2014-03-05 Thread Dan Carpenter
Hi Huang,

FYI, there are coccinelle warnings in

tree:   git://git.infradead.org/users/dedekind/l2-mtd.git master
head:   3192a724e03715a8d33955478307f21249c3196c
commit: 67766cd56820b4d81650806fe01ce7a454c6a314 [32/43] mtd: nand: parse out 
the JEDEC compliant NAND

 drivers/mtd/nand/nand_base.c:3178:36-63: duplicated argument to  or ||

git remote add l2-mtd git://git.infradead.org/users/dedekind/l2-mtd.git
git remote update l2-mtd
git checkout 67766cd56820b4d81650806fe01ce7a454c6a314
vim +3178 drivers/mtd/nand/nand_base.c

6fb277ba Florian Fainelli 2010-09-01  3162  return 1;
6fb277ba Florian Fainelli 2010-09-01  3163  }
6fb277ba Florian Fainelli 2010-09-01  3164  
6fb277ba Florian Fainelli 2010-09-01  3165  /*
67766cd5 Huang Shijie 2014-02-21  3166   * Check if the NAND chip is JEDEC 
compliant, returns 1 if it is, 0 otherwise.
67766cd5 Huang Shijie 2014-02-21  3167   */
67766cd5 Huang Shijie 2014-02-21  3168  static int 
nand_flash_detect_jedec(struct mtd_info *mtd, struct nand_chip *chip,
67766cd5 Huang Shijie 2014-02-21  3169  
int *busw)
67766cd5 Huang Shijie 2014-02-21  3170  {
67766cd5 Huang Shijie 2014-02-21  3171  struct nand_jedec_params *p = 
chip-jedec_params;
67766cd5 Huang Shijie 2014-02-21  3172  struct jedec_ecc_info *ecc;
67766cd5 Huang Shijie 2014-02-21  3173  int val;
67766cd5 Huang Shijie 2014-02-21  3174  int i, j;
67766cd5 Huang Shijie 2014-02-21  3175  
67766cd5 Huang Shijie 2014-02-21  3176  /* Try JEDEC for unknown chip 
or LP */
67766cd5 Huang Shijie 2014-02-21  3177  chip-cmdfunc(mtd, 
NAND_CMD_READID, 0x40, -1);
67766cd5 Huang Shijie 2014-02-21 @3178  if (chip-read_byte(mtd) != 'J' 
|| chip-read_byte(mtd) != 'E' ||
67766cd5 Huang Shijie 2014-02-21  3179  chip-read_byte(mtd) != 
'D' || chip-read_byte(mtd) != 'E' ||
67766cd5 Huang Shijie 2014-02-21  3180  chip-read_byte(mtd) != 
'C')
67766cd5 Huang Shijie 2014-02-21  3181  return 0;
67766cd5 Huang Shijie 2014-02-21  3182  
67766cd5 Huang Shijie 2014-02-21  3183  chip-cmdfunc(mtd, 
NAND_CMD_PARAM, 0x40, -1);
67766cd5 Huang Shijie 2014-02-21  3184  for (i = 0; i  3; i++) {
67766cd5 Huang Shijie 2014-02-21  3185  for (j = 0; j  
sizeof(*p); j++)
67766cd5 Huang Shijie 2014-02-21  3186  ((uint8_t 
*)p)[j] = chip-read_byte(mtd);

---
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] [l2-mtd:master 32/43] drivers/mtd/nand/nand_base.c:3178:36-63: duplicated argument to or ||

2014-03-05 Thread Dan Carpenter
On Wed, Mar 05, 2014 at 09:12:03PM +0100, Julia Lawall wrote:
  I agree. And I'd err on the side that keeps people from routing your
  mail to /dev/null.
 
 A human checks everything before it is sent out, at least in the case of 
 the Coccinelle messages.  In this case Dan just didn't notice the function 
 call.


Yeah.  Sorry about that.  I could have figured this one out from the
context if I had looked harder.

I will also start a review of old messages to see if anyone has been
sending them to /dev/null...

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


Re: [kbuild] [tip:master 28/29] arch/x86/platform/efi/efi.c:1084 kexec_enter_virtual_mode() warn: bitwise AND condition is false here

2014-03-07 Thread Dan Carpenter
The _PAGE_NX macro is new.  I will add it to
smatch_data/kernel.unconstant_macros to silence this false positive.

regards,
dan carpenter

On Fri, Mar 07, 2014 at 08:02:15AM +0800, kbuild test robot wrote:
 TO: Matt Fleming matt.flem...@intel.com
 CC: Ingo Molnar mi...@kernel.org
 
 
 Hi Ingo,
 
 FYI, there are new smatch warnings show up in
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git master
 head:   3a3dcbe22a11a5a0cc9310d5052be3edf4477e56
 commit: b448eb4a13cd5c469518e14e54fdb9bab66dfdcc [28/29] Merge branch 
 'x86/efi'
 :: branch date: 10 hours ago
 :: commit date: 10 hours ago
 
 arch/x86/platform/efi/efi.c:1084 kexec_enter_virtual_mode() warn: bitwise AND 
 condition is false here
 
 git remote add tip git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
 git remote update tip
 git checkout b448eb4a13cd5c469518e14e54fdb9bab66dfdcc
 vim +1084 arch/x86/platform/efi/efi.c
 
 fabb37c7 Borislav Petkov 2014-01-18  1068 BUG_ON(!efi.systab);
 fabb37c7 Borislav Petkov 2014-01-18  1069  
 fabb37c7 Borislav Petkov 2014-01-18  1070 efi_sync_low_kernel_mappings();
 fabb37c7 Borislav Petkov 2014-01-18  1071  
 fabb37c7 Borislav Petkov 2014-01-18  1072 /*
 fabb37c7 Borislav Petkov 2014-01-18  1073  * Now that EFI is in virtual 
 mode, update the function
 fabb37c7 Borislav Petkov 2014-01-18  1074  * pointers in the runtime 
 service table to the new virtual addresses.
 fabb37c7 Borislav Petkov 2014-01-18  1075  *
 fabb37c7 Borislav Petkov 2014-01-18  1076  * Call EFI services through 
 wrapper functions.
 fabb37c7 Borislav Petkov 2014-01-18  1077  */
 fabb37c7 Borislav Petkov 2014-01-18  1078 efi.runtime_version = 
 efi_systab.hdr.revision;
 994448f1 Matt Fleming2014-03-05  1079  
 994448f1 Matt Fleming2014-03-05  1080 native_runtime_setup();
 994448f1 Matt Fleming2014-03-05  1081  
 fabb37c7 Borislav Petkov 2014-01-18  1082 efi.set_virtual_address_map = 
 NULL;
 fabb37c7 Borislav Petkov 2014-01-18  1083  
 fabb37c7 Borislav Petkov 2014-01-18 @1084 if (efi_enabled(EFI_OLD_MEMMAP) 
  (__supported_pte_mask  _PAGE_NX))
 fabb37c7 Borislav Petkov 2014-01-18  1085 
 runtime_code_page_mkexec();
 fabb37c7 Borislav Petkov 2014-01-18  1086  
 fabb37c7 Borislav Petkov 2014-01-18  1087 /* clean DUMMY object */
 fabb37c7 Borislav Petkov 2014-01-18  1088 
 efi.set_variable(efi_dummy_name, EFI_DUMMY_GUID,
 fabb37c7 Borislav Petkov 2014-01-18  1089  
 EFI_VARIABLE_NON_VOLATILE |
 fabb37c7 Borislav Petkov 2014-01-18  1090  
 EFI_VARIABLE_BOOTSERVICE_ACCESS |
 fabb37c7 Borislav Petkov 2014-01-18  1091  
 EFI_VARIABLE_RUNTIME_ACCESS,
 fabb37c7 Borislav Petkov 2014-01-18  1092  0, NULL);
 
 :: The code at line 1084 was first introduced by commit
 :: fabb37c736f9f688fe3eec98550a5c032a07cfaa x86/efi: Split 
 efi_enter_virtual_mode
 
 :: TO: Borislav Petkov b...@suse.de
 :: CC: Matt Fleming matt.flem...@intel.com
 
 ---
 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] [tip:x86/threadinfo 3/5] arch/x86/kernel/dumpstack_32.c:49 dump_trace() error: we previously assumed 'task' could be null (see line 34)

2014-03-07 Thread Dan Carpenter
On Fri, Mar 07, 2014 at 10:40:15AM -0500, Steven Rostedt wrote:
 On Fri, 7 Mar 2014 10:29:46 -0500
 Steven Rostedt rost...@goodmis.org wrote:
 
  Interesting enough though, he deleted commit 028a690a1:
  
  i386: Remove unneeded test of 'task' in dump_trace()
  
  Remove unneeded test of task != NULL from
  arch/i386/kernel/traps.c::dump_trace()
  
  Probably because he took the x86_64 version instead.
 
 Ugh, I missed the actual change. He added it back in in 8a541665b9, to
 make it similar to the way dump_stack_64.c did it.  Basically, he re
 added the bug!
 
 But x86_64 was later fixed in 2012 with commit d0caf292505 by who?
 
   Dan Carpenter ;-)
 

Haha...  Back in those days I knew how current worked.  :P

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


[kbuild] [wireless-next:master 237/237] drivers/net/wireless/rtlwifi/rtl8723be/phy.c:648 _rtl8723be_store_tx_power_by_rate() error: buffer overflow 'rtlphy-tx_power_by_rate_offset[band]' 4 = 4

2014-03-26 Thread Dan Carpenter
[ Off by one still. -dan]

Hi Larry,

FYI, there are new smatch warnings show up in

tree:   
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   4e3b3bcd81776527fa6f11624d68849de8c8802e
commit: 4e3b3bcd81776527fa6f11624d68849de8c8802e [237/237] rtlwifi: rtl8723be: 
Fix array dimension problems

drivers/net/wireless/rtlwifi/rtl8723be/phy.c:648 
_rtl8723be_store_tx_power_by_rate() error: buffer overflow 
'rtlphy-tx_power_by_rate_offset[band]' 4 = 4
drivers/net/wireless/rtlwifi/rtl8723be/phy.c:648 
_rtl8723be_store_tx_power_by_rate() error: buffer overflow 
'rtlphy-tx_power_by_rate_offset[band][rfpath]' 4 = 4

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 4e3b3bcd81776527fa6f11624d68849de8c8802e
vim +648 drivers/net/wireless/rtlwifi/rtl8723be/phy.c

4e3b3bcd Larry Finger 2014-03-10  632   if (band != BAND_ON_2_4G  band != 
BAND_ON_5G) {
a619d1ab Larry Finger 2014-02-28  633   RT_TRACE(rtlpriv, COMP_POWER, 
PHY_TXPWR,
a619d1ab Larry Finger 2014-02-28  634Invalid Band %d\n, 
band);
4e3b3bcd Larry Finger 2014-03-10  635   return;
4e3b3bcd Larry Finger 2014-03-10  636   }
a619d1ab Larry Finger 2014-02-28  637  
4e3b3bcd Larry Finger 2014-03-10  638   if (rfpath  TX_PWR_BY_RATE_NUM_RF) {
a619d1ab Larry Finger 2014-02-28  639   RT_TRACE(rtlpriv, COMP_POWER, 
PHY_TXPWR,
a619d1ab Larry Finger 2014-02-28  640Invalid RfPath %d\n, 
rfpath);
4e3b3bcd Larry Finger 2014-03-10  641   return;
4e3b3bcd Larry Finger 2014-03-10  642   }
4e3b3bcd Larry Finger 2014-03-10  643   if (txnum  TX_PWR_BY_RATE_NUM_RF) {
a619d1ab Larry Finger 2014-02-28  644   RT_TRACE(rtlpriv, COMP_POWER, 
PHY_TXPWR,
a619d1ab Larry Finger 2014-02-28  645Invalid TxNum %d\n, 
txnum);
4e3b3bcd Larry Finger 2014-03-10  646   return;
4e3b3bcd Larry Finger 2014-03-10  647   }
a619d1ab Larry Finger 2014-02-28 @648   
rtlphy-tx_power_by_rate_offset[band][rfpath][txnum][rate_section] =
a619d1ab Larry Finger 2014-02-28  649   
data;
a619d1ab Larry Finger 2014-02-28  650  }
a619d1ab Larry Finger 2014-02-28  651  
a619d1ab Larry Finger 2014-02-28  652  static bool 
_rtl8723be_phy_config_bb_with_pgheaderfile(struct ieee80211_hw *hw,
a619d1ab Larry Finger 2014-02-28  653   
   u8 configtype)
a619d1ab Larry Finger 2014-02-28  654  {
a619d1ab Larry Finger 2014-02-28  655   struct rtl_priv *rtlpriv = rtl_priv(hw);
a619d1ab Larry Finger 2014-02-28  656   int i;

---
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] [scsi:pending-base 121/166] drivers/scsi/qla4xxx/ql4_os.c:1752 qla4xxx_get_ep_param() warn: variable dereferenced before check 'qla_ep' (see line 1745)

2014-03-26 Thread Dan Carpenter
Hi Vikas,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git pending-base
head:   5d3b76164c0df1d85f5c388c8b122c6c4dee5658
commit: 154f453dbf1615227bcc513e66fd44da25046652 [121/166] [SCSI] qla4xxx: 
Updated print for device login, logout path

drivers/scsi/qla4xxx/ql4_os.c:1752 qla4xxx_get_ep_param() warn: variable 
dereferenced before check 'qla_ep' (see line 1745)

git remote add scsi git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
git remote update scsi
git checkout 154f453dbf1615227bcc513e66fd44da25046652
vim +/qla_ep +1752 drivers/scsi/qla4xxx/ql4_os.c

b3a271a9 Manish Rangankar 2011-07-25  1739  char 
*buf)
b3a271a9 Manish Rangankar 2011-07-25  1740  {
b3a271a9 Manish Rangankar 2011-07-25  1741  struct qla_endpoint *qla_ep = 
ep-dd_data;
b3a271a9 Manish Rangankar 2011-07-25  1742  struct sockaddr *dst_addr;
154f453d Vikas Chaudhary  2013-12-16  1743  struct scsi_qla_host *ha;
b3a271a9 Manish Rangankar 2011-07-25  1744  
154f453d Vikas Chaudhary  2013-12-16 @1745  ha = to_qla_host(qla_ep-host);
154f453d Vikas Chaudhary  2013-12-16  1746  DEBUG2(ql4_printk(KERN_INFO, 
ha, %s: host: %ld\n, __func__,
154f453d Vikas Chaudhary  2013-12-16  1747ha-host_no));
b3a271a9 Manish Rangankar 2011-07-25  1748  
b3a271a9 Manish Rangankar 2011-07-25  1749  switch (param) {
b3a271a9 Manish Rangankar 2011-07-25  1750  case ISCSI_PARAM_CONN_PORT:
b3a271a9 Manish Rangankar 2011-07-25  1751  case ISCSI_PARAM_CONN_ADDRESS:
b3a271a9 Manish Rangankar 2011-07-25 @1752  if (!qla_ep)
b3a271a9 Manish Rangankar 2011-07-25  1753  return 
-ENOTCONN;
b3a271a9 Manish Rangankar 2011-07-25  1754  
b3a271a9 Manish Rangankar 2011-07-25  1755  dst_addr = (struct 
sockaddr *)qla_ep-dst_addr;

---
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] [ext4:test 39/40] fs/ext4/extents.c:3647 ext4_split_convert_extents() warn: suspicious bitop condition

2014-03-26 Thread Dan Carpenter
Hi Lukas,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git test
head:   ac15e0ef8030228b98ee2dd4322510e5987fceae
commit: 99950cfa591ea073c85798191a1701025e4c65ce [39/40] ext4: Introduce 
FALLOC_FL_ZERO_RANGE flag for fallocate

New smatch warnings:
fs/ext4/extents.c:3647 ext4_split_convert_extents() warn: suspicious bitop 
condition
fs/ext4/extents.c:3650 ext4_split_convert_extents() warn: suspicious bitop 
condition

Old smatch warnings:
fs/ext4/extents.c:5296 ext4_ext_shift_extents() error: 'path' dereferencing 
possible ERR_PTR()

git remote add ext4 git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
git remote update ext4
git checkout 99950cfa591ea073c85798191a1701025e4c65ce
vim +3647 fs/ext4/extents.c

667eff35 Yongqiang Yang 2011-05-03  3641depth = ext_depth(inode);
667eff35 Yongqiang Yang 2011-05-03  3642ex = path[depth].p_ext;
667eff35 Yongqiang Yang 2011-05-03  3643ee_block = 
le32_to_cpu(ex-ee_block);
667eff35 Yongqiang Yang 2011-05-03  3644ee_len = 
ext4_ext_get_actual_len(ex);
0031462b Mingming Cao   2009-09-28  3645  
99950cfa Lukas Czerner  2014-03-16  3646/* Convert to unwritten */
99950cfa Lukas Czerner  2014-03-16 @3647if (flags | 
EXT4_GET_BLOCKS_CONVERT_UNWRITTEN) {
99950cfa Lukas Czerner  2014-03-16  3648split_flag |= 
EXT4_EXT_DATA_VALID1;
99950cfa Lukas Czerner  2014-03-16  3649/* Convert to initialized */
99950cfa Lukas Czerner  2014-03-16 @3650} else if (flags | 
EXT4_GET_BLOCKS_CONVERT) {
99950cfa Lukas Czerner  2014-03-16  3651split_flag |= ee_block 
+ ee_len = eof_block ?
99950cfa Lukas Czerner  2014-03-16  3652  
EXT4_EXT_MAY_ZEROOUT : 0;
99950cfa Lukas Czerner  2014-03-16  3653split_flag |= 
(EXT4_EXT_MARK_UNINIT2  EXT4_EXT_DATA_VALID2);

---
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 1090/1368] net/netfilter/ipset/ip_set_hash_gen.h:1084 hash_ipmark_create() warn: impossible condition '(markmask 4294967295) = (0-u32max u32max)'

2014-03-26 Thread Dan Carpenter
Hi Vytas,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   e86e180b824e00733bd0e499d412a595078f9b51
commit: 4d0e5c076d01d3fb4767a502a9517923fb9a080e [1090/1368] netfilter: ipset: 
add markmask for hash:ip,mark data type

net/netfilter/ipset/ip_set_hash_gen.h:1084 hash_ipmark_create() warn: 
impossible condition '(markmask  4294967295) = (0-u32max  u32max)'

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 4d0e5c076d01d3fb4767a502a9517923fb9a080e
vim +1084 net/netfilter/ipset/ip_set_hash_gen.h

1feab10d Jozsef Kadlecsik 2013-04-08  1068  maxelem = 
ip_set_get_h32(tb[IPSET_ATTR_MAXELEM]);
1feab10d Jozsef Kadlecsik 2013-04-08  1069  
1feab10d Jozsef Kadlecsik 2013-04-08  1070  #ifdef IP_SET_HASH_WITH_NETMASK
1feab10d Jozsef Kadlecsik 2013-04-08  1071  if (tb[IPSET_ATTR_NETMASK]) {
1feab10d Jozsef Kadlecsik 2013-04-08  1072  netmask = 
nla_get_u8(tb[IPSET_ATTR_NETMASK]);
1feab10d Jozsef Kadlecsik 2013-04-08  1073  
1feab10d Jozsef Kadlecsik 2013-04-08  1074  if ((set-family == 
NFPROTO_IPV4  netmask  32) ||
1feab10d Jozsef Kadlecsik 2013-04-08  1075  (set-family == 
NFPROTO_IPV6  netmask  128) ||
1feab10d Jozsef Kadlecsik 2013-04-08  1076  netmask == 0)
1feab10d Jozsef Kadlecsik 2013-04-08  1077  return 
-IPSET_ERR_INVALID_NETMASK;
1feab10d Jozsef Kadlecsik 2013-04-08  1078  }
1feab10d Jozsef Kadlecsik 2013-04-08  1079  #endif
4d0e5c07 Vytas Dauksa 2013-12-17  1080  #ifdef IP_SET_HASH_WITH_MARKMASK
4d0e5c07 Vytas Dauksa 2013-12-17  1081  if (tb[IPSET_ATTR_MARKMASK]) {
4d0e5c07 Vytas Dauksa 2013-12-17  1082  markmask = 
ntohl(nla_get_u32(tb[IPSET_ATTR_MARKMASK]));
4d0e5c07 Vytas Dauksa 2013-12-17  1083  
4d0e5c07 Vytas Dauksa 2013-12-17 @1084  if ((markmask  
4294967295u) || markmask == 0)
4d0e5c07 Vytas Dauksa 2013-12-17  1085  return 
-IPSET_ERR_INVALID_MARKMASK;
4d0e5c07 Vytas Dauksa 2013-12-17  1086  }
4d0e5c07 Vytas Dauksa 2013-12-17  1087  #endif
1feab10d Jozsef Kadlecsik 2013-04-08  1088  
1feab10d Jozsef Kadlecsik 2013-04-08  1089  hsize = sizeof(*h);
1feab10d Jozsef Kadlecsik 2013-04-08  1090  #ifdef IP_SET_HASH_WITH_NETS
1feab10d Jozsef Kadlecsik 2013-04-08  1091  hsize += sizeof(struct 
net_prefixes) *
1feab10d Jozsef Kadlecsik 2013-04-08  1092  (set-family == 
NFPROTO_IPV4 ? 32 : 128);

---
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] [staging:staging-next 122/153] drivers/staging/slicoss/slicoss.c:1429 slic_cmdq_addcmdpage() error: we previously assumed 'pslic_handle' could be null (see line 1425)

2014-03-26 Thread Dan Carpenter
Hi Monam,

FYI, there are new smatch warnings show up in

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-next
head:   7b99b5efaab0f8c8c637cb68840e990fbca16878
commit: b0a0fb1e292e1472db7aea8ddce2fc5ceae5ab48 [122/153] Staging: slicoss: 
Replace macro with inline defination in slicoss.c

drivers/staging/slicoss/slicoss.c:1429 slic_cmdq_addcmdpage() error: we 
previously assumed 'pslic_handle' could be null (see line 1425)

git remote add staging 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git remote update staging
git checkout b0a0fb1e292e1472db7aea8ddce2fc5ceae5ab48
vim +/pslic_handle +1429 drivers/staging/slicoss/slicoss.c

4d6ea9c3 Denis Kirjanov 2010-07-10  1419while ((cmdcnt  
SLIC_CMDQ_CMDSINPAGE) 
4d6ea9c3 Denis Kirjanov 2010-07-10  1420   (adapter-slic_handle_ix 
 256)) {
4d6ea9c3 Denis Kirjanov 2010-07-10  1421/* Allocate and 
initialize a SLIC_HANDLE for this command */
b0a0fb1e Monam Agarwal  2014-03-09  1422
spin_lock_irqsave(adapter-handle_lock.lock,
b0a0fb1e Monam Agarwal  2014-03-09  1423
adapter-handle_lock.flags);
b0a0fb1e Monam Agarwal  2014-03-09  1424pslic_handle  =  
adapter-pfree_slic_handles;
b0a0fb1e Monam Agarwal  2014-03-09 @1425if (pslic_handle)
b0a0fb1e Monam Agarwal  2014-03-09  1426
adapter-pfree_slic_handles = pslic_handle-next;
b0a0fb1e Monam Agarwal  2014-03-09  1427
spin_unlock_irqrestore(adapter-handle_lock.lock,
b0a0fb1e Monam Agarwal  2014-03-09  1428
adapter-handle_lock.flags);
4d6ea9c3 Denis Kirjanov 2010-07-10 @1429pslic_handle-type = 
SLIC_HANDLE_CMD;
4d6ea9c3 Denis Kirjanov 2010-07-10  1430pslic_handle-address = 
(void *) cmd;
4d6ea9c3 Denis Kirjanov 2010-07-10  1431pslic_handle-offset = 
(ushort) adapter-slic_handle_ix++;
4d6ea9c3 Denis Kirjanov 2010-07-10  1432
pslic_handle-other_handle = NULL;

---
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] [kbuild-all] [wireless-next:master 316/316] drivers/net/wireless/rsi/rsi_91x_debugfs.c:296 rsi_init_dbgfs() error: potential null dereference 'dev_dbgfs'. (kzalloc returns null)

2014-03-27 Thread Dan Carpenter
On Tue, Mar 18, 2014 at 04:12:25AM +0800, kbuild test robot wrote:
 tree:   
 git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git 
 master
 head:   dad0d04fa7ba41ce603a01e8e64967650303e9a2
 commit: dad0d04fa7ba41ce603a01e8e64967650303e9a2 [316/316] rsi: Add RS9113 
 wireless driver
 
 drivers/net/wireless/rsi/rsi_91x_debugfs.c:296 rsi_init_dbgfs() error: 
 potential null dereference 'dev_dbgfs'.  (kzalloc returns null)
 drivers/net/wireless/rsi/rsi_91x_debugfs.c:307 rsi_init_dbgfs() error: 
 dereferencing freed memory 'dev_dbgfs'
 drivers/net/wireless/rsi/rsi_91x_sdio.c:762 rsi_disconnect() warn: variable 
 dereferenced before check 'adapter' (see line 760)
 drivers/net/wireless/rsi/rsi_91x_sdio_ops.c:250 rsi_process_pkt() warn: 
 returning -1 instead of -ENOMEM is sloppy
 drivers/net/wireless/rsi/rsi_91x_usb.c:160 rsi_usb_reg_read() error: doing 
 dma on the stack (temp_buf)
 drivers/net/wireless/rsi/rsi_91x_usb.c:201 rsi_usb_reg_write() error: doing 
 dma on the stack (usb_reg_buf)
 drivers/net/wireless/rsi/rsi_91x_usb.c:289 rsi_usb_write_register_multiple() 
 warn: '__min2' 4096 can't fit into 255 'transfer'
 
 vim +/dev_dbgfs +296 drivers/net/wireless/rsi/rsi_91x_debugfs.c
 
290
291dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL);
292adapter-dfsentry = dev_dbgfs;
293
294snprintf(devdir, sizeof(devdir), %s,
295 wiphy_name(adapter-hw-wiphy));
   296dev_dbgfs-subdir = debugfs_create_dir(devdir, NULL);
297
298if (IS_ERR(dev_dbgfs-subdir)) {

Btw, this isn't needed at all.  It's also wrong.  The error message is
misleading.

debugfs only returns error pointers if the kernel was compiled without
debugfs support.  The debugfs_create_file() function accepts NULL
pointers.

There is no need for error handling here by design.

regards,
dan carpenter

299if (dev_dbgfs-subdir == ERR_PTR(-ENODEV))
300rsi_dbg(ERR_ZONE,
301%s:Debugfs has not been 
 mounted\n, __func__);
302else
303rsi_dbg(ERR_ZONE, debugfs:%s not 
 created\n, devdir);
304
305adapter-dfsentry = NULL;
306kfree(dev_dbgfs);
307return (int)PTR_ERR(dev_dbgfs-subdir);
308} else {
309for (ii = 0; ii  adapter-num_debugfs_entries; 
 ii++) {
310files = dev_debugfs_files[ii];
 
 ---
 0-DAY kernel build testing backend  Open Source Technology Center
 http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
 ___
 kbuild-all mailing list
 kbuild-...@lists.01.org
 https://lists.01.org/mailman/listinfo/kbuild-all
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [kbuild-all] [wireless-next:master 316/316] drivers/net/wireless/rsi/rsi_91x_debugfs.c:296 rsi_init_dbgfs() error: potential null dereference 'dev_dbgfs'. (kzalloc returns null)

2014-03-27 Thread Dan Carpenter
On Thu, Mar 27, 2014 at 06:45:07PM +0300, Dan Carpenter wrote:
  drivers/net/wireless/rsi/rsi_91x_usb.c:289 
  rsi_usb_write_register_multiple() warn: '__min2' 4096 can't fit into 255 
  'transfer'

The code for this one is:

transfer = min_t(int, count, 4096);

It's complaining because tranfers is u8, but the cast to int always
makes me worry negative values.  In this case, count is not user
controlled so it's safe.  But that's a common security problem you
should be aware of.  It's better to cast it to an unsigned value.

regards,
dan carpenter

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


Re: [kbuild] [input:next 498/499] drivers/input/touchscreen/edt-ft5x06.c:222 edt_ft5x06_ts_isr() warn: buffer overflow 'rdbuf' 29 = 29

2014-03-31 Thread Dan Carpenter
False positive.  Smatch is using the highest possible values of tplen
and offset but they both can't be maxed at the same time.

regards,
dan carpenter

On Sat, Mar 29, 2014 at 02:05:37AM +0800, kbuild test robot wrote:
 TO: Lothar Waßmann l...@karo-electronics.de
 CC: Dmitry Torokhov dmitry.torok...@gmail.com
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
 head:   608edb0f130a90823892eaaf48de159bdc849a00
 commit: fd335ab04b3f1b3309dfbfea71a1a79a7bacc4ad [498/499] Input: edt-ft5x06 
 - add support for M09 firmware version
 :: branch date: 80 minutes ago
 :: commit date: 2 hours ago
 
 drivers/input/touchscreen/edt-ft5x06.c:222 edt_ft5x06_ts_isr() warn: buffer 
 overflow 'rdbuf' 29 = 29
 
 git remote add input 
 git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
 git remote update input
 git checkout fd335ab04b3f1b3309dfbfea71a1a79a7bacc4ad
 vim +/rdbuf +222 drivers/input/touchscreen/edt-ft5x06.c
 
 43c4d13e Simon Budig2012-07-24  206  
 fd335ab0 Lothar Waßmann 2014-03-28  207   /* M09 does not send header or 
 CRC */
 fd335ab0 Lothar Waßmann 2014-03-28  208   if (tsdata-version == M06) {
 fd335ab0 Lothar Waßmann 2014-03-28  209   if (rdbuf[0] != 0xaa || 
 rdbuf[1] != 0xaa ||
 fd335ab0 Lothar Waßmann 2014-03-28  210   rdbuf[2] != 
 datalen) {
 fd335ab0 Lothar Waßmann 2014-03-28  211   
 dev_err_ratelimited(dev,
 fd335ab0 Lothar Waßmann 2014-03-28  212   
 Unexpected header: %02x%02x%02x!\n,
 fd335ab0 Lothar Waßmann 2014-03-28  213   
 rdbuf[0], rdbuf[1], rdbuf[2]);
 fd335ab0 Lothar Waßmann 2014-03-28  214   goto out;
 fd335ab0 Lothar Waßmann 2014-03-28  215   }
 43c4d13e Simon Budig2012-07-24  216  
 fd335ab0 Lothar Waßmann 2014-03-28  217   if 
 (!edt_ft5x06_ts_check_crc(tsdata, rdbuf, datalen))
 fd335ab0 Lothar Waßmann 2014-03-28  218   goto out;
 fd335ab0 Lothar Waßmann 2014-03-28  219   }
 43c4d13e Simon Budig2012-07-24  220  
 43c4d13e Simon Budig2012-07-24  221   for (i = 0; i  
 MAX_SUPPORT_POINTS; i++) {
 fd335ab0 Lothar Waßmann 2014-03-28 @222   u8 *buf = rdbuf[i * 
 tplen + offset];
 43c4d13e Simon Budig2012-07-24  223   bool down;
 43c4d13e Simon Budig2012-07-24  224  
 43c4d13e Simon Budig2012-07-24  225   type = buf[0]  6;
 43c4d13e Simon Budig2012-07-24  226   /* ignore Reserved 
 events */
 43c4d13e Simon Budig2012-07-24  227   if (type == 
 TOUCH_EVENT_RESERVED)
 43c4d13e Simon Budig2012-07-24  228   continue;
 43c4d13e Simon Budig2012-07-24  229  
 fd335ab0 Lothar Waßmann 2014-03-28  230   /* M06 sometimes sends 
 bogus coordinates in TOUCH_DOWN */
 
 ---
 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 5/6] drivers/nfc/pn544/i2c.c:1032 pn544_hci_i2c_probe() error: we previously assumed 'pdata' could be null (see line 980)

2014-04-08 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next.git master
head:   871e11b1a27ff07efb1d23944952a288fdb02845
commit: 49aa75f13ab9eb5f5ad19c69998dd3cf6403942e [5/6] NFC: pn544: i2c: Add 
device-tree (Open Firmware) support to PN544

drivers/nfc/pn544/i2c.c:1032 pn544_hci_i2c_probe() error: we previously assumed 
'pdata' could be null (see line 980)

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 49aa75f13ab9eb5f5ad19c69998dd3cf6403942e
vim +/pdata +1032 drivers/nfc/pn544/i2c.c

97f18414 Eric Lapuyade  2012-10-02   974phy-i2c_dev = client;
97f18414 Eric Lapuyade  2012-10-02   975i2c_set_clientdata(client, phy);
97f18414 Eric Lapuyade  2012-10-02   976  
97f18414 Eric Lapuyade  2012-10-02   977pdata = 
client-dev.platform_data;
97f18414 Eric Lapuyade  2012-10-02   978  
49aa75f1 Clement Perrochaud 2014-04-02   979/* No platform data, using 
device tree. */
49aa75f1 Clement Perrochaud 2014-04-02  @980if (!pdata  
client-dev.of_node) {
49aa75f1 Clement Perrochaud 2014-04-02   981r = 
pn544_hci_i2c_of_request_resources(client);
49aa75f1 Clement Perrochaud 2014-04-02   982if (r) {
49aa75f1 Clement Perrochaud 2014-04-02   983
nfc_err(client-dev, No DT data\n);
49aa75f1 Clement Perrochaud 2014-04-02   984return r;
49aa75f1 Clement Perrochaud 2014-04-02   985}
49aa75f1 Clement Perrochaud 2014-04-02   986/* Using platform data. */
49aa75f1 Clement Perrochaud 2014-04-02   987} else if (pdata) {
97f18414 Eric Lapuyade  2012-10-02   988  
49aa75f1 Clement Perrochaud 2014-04-02   989if 
(pdata-request_resources == NULL) {
49aa75f1 Clement Perrochaud 2014-04-02   990
nfc_err(client-dev, request_resources() missing\n);
49aa75f1 Clement Perrochaud 2014-04-02   991return -EINVAL;
49aa75f1 Clement Perrochaud 2014-04-02   992}
49aa75f1 Clement Perrochaud 2014-04-02   993  
49aa75f1 Clement Perrochaud 2014-04-02   994r = 
pdata-request_resources(client);
49aa75f1 Clement Perrochaud 2014-04-02   995if (r) {
49aa75f1 Clement Perrochaud 2014-04-02   996
nfc_err(client-dev,
49aa75f1 Clement Perrochaud 2014-04-02   997Cannot 
get platform resources\n);
49aa75f1 Clement Perrochaud 2014-04-02   998return r;
49aa75f1 Clement Perrochaud 2014-04-02   999}
97f18414 Eric Lapuyade  2012-10-02  1000  
49aa75f1 Clement Perrochaud 2014-04-02  1001phy-gpio_en = 
pdata-get_gpio(NFC_GPIO_ENABLE);
49aa75f1 Clement Perrochaud 2014-04-02  1002phy-gpio_fw = 
pdata-get_gpio(NFC_GPIO_FW_RESET);
49aa75f1 Clement Perrochaud 2014-04-02  1003phy-gpio_irq = 
pdata-get_gpio(NFC_GPIO_IRQ);
49aa75f1 Clement Perrochaud 2014-04-02  1004} else {
49aa75f1 Clement Perrochaud 2014-04-02  1005nfc_err(client-dev, 
No platform data\n);
49aa75f1 Clement Perrochaud 2014-04-02  1006return -EINVAL;
49aa75f1 Clement Perrochaud 2014-04-02  1007}
97f18414 Eric Lapuyade  2012-10-02  1008  
97f18414 Eric Lapuyade  2012-10-02  1009
pn544_hci_i2c_platform_init(phy);
97f18414 Eric Lapuyade  2012-10-02  1010  
97f18414 Eric Lapuyade  2012-10-02  1011r = 
request_threaded_irq(client-irq, NULL, pn544_hci_i2c_irq_thread_fn,
97f18414 Eric Lapuyade  2012-10-02  1012 
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
97f18414 Eric Lapuyade  2012-10-02  1013 
PN544_HCI_I2C_DRIVER_NAME, phy);
97f18414 Eric Lapuyade  2012-10-02  1014if (r  0) {
17936b43 Joe Perches2013-04-05  1015nfc_err(client-dev, 
Unable to register IRQ handler\n);
97f18414 Eric Lapuyade  2012-10-02  1016goto err_rti;
97f18414 Eric Lapuyade  2012-10-02  1017}
97f18414 Eric Lapuyade  2012-10-02  1018  
97f18414 Eric Lapuyade  2012-10-02  1019r = pn544_hci_probe(phy, 
i2c_phy_ops, LLC_SHDLC_NAME,
97f18414 Eric Lapuyade  2012-10-02  1020
PN544_I2C_FRAME_HEADROOM, PN544_I2C_FRAME_TAILROOM,
06c66034 Eric Lapuyade  2013-07-19  1021
PN544_HCI_I2C_LLC_MAX_PAYLOAD,
06c66034 Eric Lapuyade  2013-07-19  1022
pn544_hci_i2c_fw_download, phy-hdev);
97f18414 Eric Lapuyade  2012-10-02  1023if (r  0)
97f18414 Eric Lapuyade  2012-10-02  1024goto err_hci;
97f18414 Eric Lapuyade  2012-10-02  1025  
97f18414 Eric Lapuyade  2012-10-02  1026return 0;
97f18414 Eric Lapuyade  2012-10-02  1027  
97f18414 Eric Lapuyade  2012-10-02  1028  err_hci:
97f18414 Eric Lapuyade  2012-10-02  1029free_irq(client-irq, phy);
97f18414 Eric Lapuyade  2012-10-02  1030  
97f18414 Eric Lapuyade  2012-10-02  1031  err_rti:

Re: [kbuild] [net-next:master 1090/1368] net/netfilter/ipset/ip_set_hash_gen.h:1084 hash_ipmark_create() warn: impossible condition '(markmask 4294967295) = (0-u32max u32max)'

2014-04-08 Thread Dan Carpenter
On Mon, Apr 07, 2014 at 10:05:47PM +0200, Jozsef Kadlecsik wrote:
 On Mon, 7 Apr 2014, Vytas Dauksa wrote:
 
  sorry, I am relatively new to this. This patch is for netfilter ipset
  repo, which has both kernelspace and userspace code, hence the kernel
  directory.
  If Jozsef, can't review it here, I am happy to send it via netfilter
  mailing list, probably, where it should have went the first time.
 
 The normal way is that I collect the ipset related patches in my git tree
 and then submit them in a batch to Pablo for netfilter intregration who
 then send them to DaveM.
 
 Should this fix be submitted fast into the kernel? We are out out the
 window.

You might as well put it into net-next since it's not a bugfix.  The
net-next window doesn't open up until after the -rc1 is released.

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


[kbuild] [drm:i915-mst-hacks 74/81] drivers/gpu/drm/drm_dp_helper.c:1500 drm_dp_mst_topology_mgr_set_mst() warn: inconsistent returns mutex:mgr-lock: locked (1479 [(-12)]) unlocked (1500 [0])

2014-04-08 Thread Dan Carpenter
tree:   git://people.freedesktop.org/~airlied/linux.git i915-mst-hacks
head:   af3004ad2f660105ec8c5e623ece3b6055a76bd4
commit: 168c73f18028a35f98707f282576765be7becca7 [74/81] start adding drm MST 
branch device and port trees

drivers/gpu/drm/drm_dp_helper.c:1500 drm_dp_mst_topology_mgr_set_mst() warn: 
inconsistent returns mutex:mgr-lock: locked (1479 [(-12)]) unlocked (1500 [0])

git remote add drm git://people.freedesktop.org/~airlied/linux.git
git remote update drm
git checkout 168c73f18028a35f98707f282576765be7becca7
vim +1500 drivers/gpu/drm/drm_dp_helper.c

4c8074ff Dave Airlie 2014-04-04  1484   /* kick off link address 
discovery */
168c73f1 Dave Airlie 2014-04-08  1485   
drm_dp_send_initial_link_address(mgr, mstb);
168c73f1 Dave Airlie 2014-04-08  1486  
168c73f1 Dave Airlie 2014-04-08  1487   drm_dp_check_guid_is_valid(mgr, 
mstb);
168c73f1 Dave Airlie 2014-04-08  1488  
4c8074ff Dave Airlie 2014-04-04  1489   } else {
168c73f1 Dave Airlie 2014-04-08  1490   if (mgr-mst_primary) {
168c73f1 Dave Airlie 2014-04-08  1491   
drm_dp_destroy_mst_branch_device(mgr-mst_primary);
168c73f1 Dave Airlie 2014-04-08  1492   mgr-mst_primary = NULL;
168c73f1 Dave Airlie 2014-04-08  1493   }
4c8074ff Dave Airlie 2014-04-04  1494   /* disable MST on the device */
4c8074ff Dave Airlie 2014-04-04  1495   ret = 
drm_dp_dpcd_writeb(mgr-aux, DP_MSTM_CTRL, 0);
4c8074ff Dave Airlie 2014-04-04  1496   }
4c8074ff Dave Airlie 2014-04-04  1497  
4c8074ff Dave Airlie 2014-04-04  1498  out_unlock:
4c8074ff Dave Airlie 2014-04-04  1499   mutex_unlock(mgr-lock);
4c8074ff Dave Airlie 2014-04-04 @1500   return 0;

Also should this be return ret; or something?

4c8074ff Dave Airlie 2014-04-04  1501  }
4c8074ff Dave Airlie 2014-04-04  1502  
EXPORT_SYMBOL(drm_dp_mst_topology_mgr_set_mst);
4c8074ff Dave Airlie 2014-04-04  1503  
8ca19f0a Dave Airlie 2014-04-04  1504  static void drm_dp_get_one_sb_msg(struct 
drm_dp_mst_topology_mgr *mgr, bool up)
4c8074ff Dave Airlie 2014-04-04  1505  {
168c73f1 Dave Airlie 2014-04-08  1506   int len;
4c8074ff Dave Airlie 2014-04-04  1507   u8 replyblock[32];
4c8074ff Dave Airlie 2014-04-04  1508   int replylen, origlen, curreply;

---
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] [tchen:timer_debug3 2/2] kernel/time/clocksource.c:367 clocksource_cpu_notify() warn: statement has no effect 3

2014-04-08 Thread Dan Carpenter
This code has a compile problem.  Missing argument to spin_lock_irqsave().

regards,
dan carpenter

On Wed, Apr 09, 2014 at 01:34:15AM +0800, kbuild test robot wrote:
 TO: Jet Chen jet.c...@intel.com
 
 tree:   git://bee.sh.intel.com/git/tchen37/linux.git timer_debug3
 head:   c7c05c6a3c9c585a0d74c052a2908bf159d09f7f
 commit: c7c05c6a3c9c585a0d74c052a2908bf159d09f7f [2/2] Should use 
 SOFTIRQ-safe lock in this scenario
 :: branch date: 66 minutes ago
 :: commit date: 66 minutes ago
 
 kernel/time/clocksource.c:367 clocksource_cpu_notify() warn: statement has no 
 effect 3
 
 git remote add tchen git://bee.sh.intel.com/git/tchen37/linux.git
 git remote update tchen
 git checkout c7c05c6a3c9c585a0d74c052a2908bf159d09f7f
 vim +367 kernel/time/clocksource.c
 
 9fb60336 Thomas Gleixner2011-09-12  351* We only clear the 
 watchdog_reset_pending, when we did a
 9fb60336 Thomas Gleixner2011-09-12  352* full cycle through all 
 clocksources.
 9fb60336 Thomas Gleixner2011-09-12  353*/
 9fb60336 Thomas Gleixner2011-09-12  354   if (reset_pending)
 9fb60336 Thomas Gleixner2011-09-12  355   
 atomic_dec(watchdog_reset_pending);
 9fb60336 Thomas Gleixner2011-09-12  356  
 90585a71 Viresh Kumar   2014-04-05  357   queue_timer_on_next_cpu();
 fb63a0eb Martin Schwidefsky 2009-08-14  358  out:
 5d8b34fd Thomas Gleixner2007-02-16  359   spin_unlock(watchdog_lock);
 5d8b34fd Thomas Gleixner2007-02-16  360  }
 0f8e8ef7 Martin Schwidefsky 2009-08-14  361  
 90585a71 Viresh Kumar   2014-04-05  362  static int 
 clocksource_cpu_notify(struct notifier_block *self,
 90585a71 Viresh Kumar   2014-04-05  363   
 unsigned long action, void *hcpu)
 90585a71 Viresh Kumar   2014-04-05  364  {
 90585a71 Viresh Kumar   2014-04-05  365   long cpu = (long)hcpu;
 90585a71 Viresh Kumar   2014-04-05  366  
 c7c05c6a Jet Chen   2014-04-09 @367   
 spin_lock_irqsave(watchdog_lock);
 90585a71 Viresh Kumar   2014-04-05  368   if (!watchdog_running)
 90585a71 Viresh Kumar   2014-04-05  369   goto notify_out;
 90585a71 Viresh Kumar   2014-04-05  370  
 90585a71 Viresh Kumar   2014-04-05  371   switch (action) {
 90585a71 Viresh Kumar   2014-04-05  372   case CPU_DEAD:
 90585a71 Viresh Kumar   2014-04-05  373   case CPU_DEAD_FROZEN:
 90585a71 Viresh Kumar   2014-04-05  374   if (cpu != timer_cpu)
 90585a71 Viresh Kumar   2014-04-05  375   break;
 
 ---
 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:drm-i915-mst-support 18/18] drivers/gpu/drm/drm_dp_mst_topology.c:379:2-8: preceding lock on line 377

2014-05-08 Thread Dan Carpenter
[ I glanced at the context and it does seem buggy - dan].

tree:   git://people.freedesktop.org/~airlied/linux.git drm-i915-mst-support
head:   4ec03267a2482d9719006adcc3eec300e0243a5a
commit: 4ec03267a2482d9719006adcc3eec300e0243a5a [18/18] WIP: locking fixups

 drivers/gpu/drm/drm_dp_mst_topology.c:379:2-8: preceding lock on line 377
 drivers/gpu/drm/drm_dp_mst_topology.c:390:2-8: preceding lock on line 388

git remote add drm git://people.freedesktop.org/~airlied/linux.git
git remote update drm
git checkout 4ec03267a2482d9719006adcc3eec300e0243a5a
vim +379 drivers/gpu/drm/drm_dp_mst_topology.c

4ec03267 Dave Airlie 2014-05-08  371return NULL;
4ec03267 Dave Airlie 2014-05-08  372  }
4ec03267 Dave Airlie 2014-05-08  373  
4ec03267 Dave Airlie 2014-05-08  374  static struct drm_dp_mst_branch 
*drm_dp_get_validated_mstb_ref(struct drm_dp_mst_topology_mgr *mgr, struct 
drm_dp_mst_branch *mstb)
4ec03267 Dave Airlie 2014-05-08  375  {
4ec03267 Dave Airlie 2014-05-08  376struct drm_dp_mst_branch *rmstb;
4ec03267 Dave Airlie 2014-05-08 @377mutex_lock(mgr-lock);
4ec03267 Dave Airlie 2014-05-08  378if (!mgr-mst_primary)
4ec03267 Dave Airlie 2014-05-08 @379return NULL;
4ec03267 Dave Airlie 2014-05-08  380rmstb = 
drm_dp_mst_get_validated_mstb_ref_locked(mgr-mst_primary, mstb);
4ec03267 Dave Airlie 2014-05-08  381mutex_unlock(mgr-lock);
4ec03267 Dave Airlie 2014-05-08  382return rmstb;   
4ec03267 Dave Airlie 2014-05-08  383  }
4ec03267 Dave Airlie 2014-05-08  384  
4ec03267 Dave Airlie 2014-05-08  385  static struct drm_dp_mst_port 
*drm_dp_get_validated_port_ref(struct drm_dp_mst_topology_mgr *mgr, struct 
drm_dp_mst_port *port)
4ec03267 Dave Airlie 2014-05-08  386  {
4ec03267 Dave Airlie 2014-05-08  387struct drm_dp_mst_port *rport;
4ec03267 Dave Airlie 2014-05-08 @388mutex_lock(mgr-lock);
4ec03267 Dave Airlie 2014-05-08  389if (!mgr-mst_primary)
4ec03267 Dave Airlie 2014-05-08 @390return NULL;
4ec03267 Dave Airlie 2014-05-08  391rport = 
drm_dp_mst_get_port_ref_locked(mgr-mst_primary, port);
4ec03267 Dave Airlie 2014-05-08  392mutex_unlock(mgr-lock);
4ec03267 Dave Airlie 2014-05-08  393return rport;

---
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] [mmotm:master 192/459] fs/proc/task_mmu.c:769 clear_refs_test_walk() warn: bitwise AND condition is false here

2014-05-13 Thread Dan Carpenter
I have added VM_SOFTDIRTY to smatch_data/kernel.unconstant_macros to
silence this false positive.

regards,
dan carpenter


On Sat, May 10, 2014 at 08:57:51AM +0800, kbuild test robot wrote:
 TO: Cyrill Gorcunov gorcu...@gmail.com
 CC: Johannes Weiner han...@cmpxchg.org
 CC: Andrew Morton a...@linux-foundation.org
 CC: Linux Memory Management List linux...@kvack.org
 
 Hi Cyrill,
 
 First bad commit (maybe != root cause):
 
 tree:   git://git.cmpxchg.org/linux-mmotm.git master
 head:   9567896580328249f6519fda78cf9fe185a8486d
 commit: 42e82fd9aa0a10d06a5642f8b83af8dc443f0e3a [192/459] mm: pgtable -- 
 Require X86_64 for soft-dirty tracker, v2
 :: branch date: 49 minutes ago
 :: commit date: 51 minutes ago
 
 fs/proc/task_mmu.c:769 clear_refs_test_walk() warn: bitwise AND condition is 
 false here
 fs/proc/task_mmu.c:928 pte_to_pagemap_entry() warn: bitwise AND condition is 
 false here
 fs/proc/task_mmu.c:936 pte_to_pagemap_entry() warn: bitwise AND condition is 
 false here
 fs/proc/task_mmu.c:993 pagemap_pmd() warn: bitwise AND condition is false here
 fs/proc/task_mmu.c:1039 pagemap_hugetlb() warn: bitwise AND condition is 
 false here
 
 git remote add mmotm git://git.cmpxchg.org/linux-mmotm.git
 git remote update mmotm
 git checkout 42e82fd9aa0a10d06a5642f8b83af8dc443f0e3a
 vim +769 fs/proc/task_mmu.c
 
 436a162d3 Naoya Horiguchi   2014-05-10  763*/
 436a162d3 Naoya Horiguchi   2014-05-10  764   if (cp-type == 
 CLEAR_REFS_ANON  vma-vm_file)
 436a162d3 Naoya Horiguchi   2014-05-10  765   walk-skip = 1;
 436a162d3 Naoya Horiguchi   2014-05-10  766   if (cp-type == 
 CLEAR_REFS_MAPPED  !vma-vm_file)
 436a162d3 Naoya Horiguchi   2014-05-10  767   walk-skip = 1;
 6041cafc9 Cyrill Gorcunov   2014-05-10  768   if (cp-type == 
 CLEAR_REFS_SOFT_DIRTY) {
 6041cafc9 Cyrill Gorcunov   2014-05-10 @769   if 
 (vma-vm_flags  VM_SOFTDIRTY)
 6041cafc9 Cyrill Gorcunov   2014-05-10  770   
 vma-vm_flags = ~VM_SOFTDIRTY;
 6041cafc9 Cyrill Gorcunov   2014-05-10  771   }
 a6198797c Matt Mackall  2008-02-04  772   return 0;
 a6198797c Matt Mackall  2008-02-04  773  }
 a6198797c Matt Mackall  2008-02-04  774  
 f248dcb34 Matt Mackall  2008-02-04  775  static ssize_t 
 clear_refs_write(struct file *file, const char __user *buf,
 f248dcb34 Matt Mackall  2008-02-04  776   
 size_t count, loff_t *ppos)
 b813e931b David Rientjes2007-05-06  777  {
 f248dcb34 Matt Mackall  2008-02-04  778   struct task_struct 
 *task;
 fb92a4b06 Vincent Li2009-09-22  779   char 
 buffer[PROC_NUMBUF];
 f248dcb34 Matt Mackall  2008-02-04  780   struct mm_struct *mm;
 b813e931b David Rientjes2007-05-06  781   struct vm_area_struct 
 *vma;
 040fa0207 Pavel Emelyanov   2013-07-03  782   enum clear_refs_types 
 type;
 040fa0207 Pavel Emelyanov   2013-07-03  783   int itype;
 0a8cb8e34 Alexey Dobriyan   2011-05-26  784   int rv;
 b813e931b David Rientjes2007-05-06  785  
 f248dcb34 Matt Mackall  2008-02-04  786   memset(buffer, 0, 
 sizeof(buffer));
 f248dcb34 Matt Mackall  2008-02-04  787   if (count  
 sizeof(buffer) - 1)
 f248dcb34 Matt Mackall  2008-02-04  788   count = 
 sizeof(buffer) - 1;
 f248dcb34 Matt Mackall  2008-02-04  789   if 
 (copy_from_user(buffer, buf, count))
 f248dcb34 Matt Mackall  2008-02-04  790   return -EFAULT;
 040fa0207 Pavel Emelyanov   2013-07-03  791   rv = 
 kstrtoint(strstrip(buffer), 10, itype);
 0a8cb8e34 Alexey Dobriyan   2011-05-26  792   if (rv  0)
 0a8cb8e34 Alexey Dobriyan   2011-05-26  793   return rv;
 040fa0207 Pavel Emelyanov   2013-07-03  794   type = (enum 
 clear_refs_types)itype;
 040fa0207 Pavel Emelyanov   2013-07-03  795   if (type  
 CLEAR_REFS_ALL || type = CLEAR_REFS_LAST)
 f248dcb34 Matt Mackall  2008-02-04  796   return -EINVAL;
 541c237c0 Pavel Emelyanov   2013-07-03  797  
 541c237c0 Pavel Emelyanov   2013-07-03  798   if (type == 
 CLEAR_REFS_SOFT_DIRTY) {
 541c237c0 Pavel Emelyanov   2013-07-03  799   
 soft_dirty_cleared = true;
 6041cafc9 Cyrill Gorcunov   2014-05-10  800   
 pr_warn_once(The pagemap bits 55-60 has changed their meaning!
 6041cafc9 Cyrill Gorcunov   2014-05-10  801 
 See the linux/Documentation/vm/pagemap.txt for 
 6041cafc9 Cyrill Gorcunov   2014-05-10  802
 details.\n);
 541c237c0 Pavel Emelyanov   2013-07-03  803   }
 541c237c0 Pavel Emelyanov   2013-07-03  804  
 496ad9aa8 Al Viro   2013-01-23  805   task = 
 get_proc_task(file_inode(file));
 f248dcb34 Matt Mackall  2008-02-04  806   if (!task

[kbuild] [net-next:master 710/719] net/mac802154/llsec.c:781 mac802154_llsec_encrypt() warn: inconsistent returns bottom_half:: locked (781 [(-126)], 781 [(-22)]) unlocked (723 [(-22)], 727 [0], 733 [

2014-05-17 Thread Dan Carpenter

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   97dc48e220282742e4c4a8fde81bdd4dbe011f1e
commit: 03556e4d0dbbbf4af9df76f4a3839c86f6afb015 [710/719] mac802154: add llsec 
encryption method

net/mac802154/llsec.c:781 mac802154_llsec_encrypt() warn: inconsistent returns 
bottom_half:: locked (781 [(-126)], 781 [(-22)]) unlocked (723 [(-22)], 727 
[0], 733 [(-90)], 775 [s32min-(-1)], 775 [0], 781 [(-75)])

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 03556e4d0dbbbf4af9df76f4a3839c86f6afb015
vim +781 net/mac802154/llsec.c

03556e4d Phoebe Buckheister 2014-05-16  765 write_unlock_bh(sec-lock);
03556e4d Phoebe Buckheister 2014-05-16  766  
03556e4d Phoebe Buckheister 2014-05-16  767 rcu_read_unlock();
03556e4d Phoebe Buckheister 2014-05-16  768  
03556e4d Phoebe Buckheister 2014-05-16  769 skb-mac_len = 
ieee802154_hdr_push(skb, hdr);
03556e4d Phoebe Buckheister 2014-05-16  770 skb_reset_mac_header(skb);
03556e4d Phoebe Buckheister 2014-05-16  771  
03556e4d Phoebe Buckheister 2014-05-16  772 rc = llsec_do_encrypt(skb, sec, 
hdr, key);
03556e4d Phoebe Buckheister 2014-05-16  773 llsec_key_put(key);
03556e4d Phoebe Buckheister 2014-05-16  774  
03556e4d Phoebe Buckheister 2014-05-16  775 return rc  0 ? rc : 0;
03556e4d Phoebe Buckheister 2014-05-16  776  
03556e4d Phoebe Buckheister 2014-05-16  777  fail_read:
03556e4d Phoebe Buckheister 2014-05-16  778 read_unlock(sec-lock);

This should probably be read_unlock_bh().

03556e4d Phoebe Buckheister 2014-05-16  779  fail:
03556e4d Phoebe Buckheister 2014-05-16  780 rcu_read_unlock();
03556e4d Phoebe Buckheister 2014-05-16 @781 return rc;
03556e4d Phoebe Buckheister 2014-05-16  782  }

---
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 710/719] net/mac802154/llsec.c:781 mac802154_llsec_encrypt() warn: inconsistent returns bottom_half:: locked (781 [(-126)], 781 [(-22)]) unlocked (723 [(-22)], 727 [0], 7

2014-05-17 Thread Dan Carpenter
On Sat, May 17, 2014 at 11:56:13PM +0300, Dan Carpenter wrote:
 
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
 master
 head:   97dc48e220282742e4c4a8fde81bdd4dbe011f1e
 commit: 03556e4d0dbbbf4af9df76f4a3839c86f6afb015 [710/719] mac802154: add 
 llsec encryption method
 
 net/mac802154/llsec.c:781 mac802154_llsec_encrypt() warn: inconsistent 
 returns bottom_half:: locked (781 [(-126)], 781 [(-22)]) unlocked (723 
 [(-22)], 727 [0], 733 [(-90)], 775 [s32min-(-1)], 775 [0], 781 [(-75)])
 
 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 03556e4d0dbbbf4af9df76f4a3839c86f6afb015
 vim +781 net/mac802154/llsec.c
 
 03556e4d Phoebe Buckheister 2014-05-16  765   write_unlock_bh(sec-lock);
 03556e4d Phoebe Buckheister 2014-05-16  766  
 03556e4d Phoebe Buckheister 2014-05-16  767   rcu_read_unlock();
 03556e4d Phoebe Buckheister 2014-05-16  768  
 03556e4d Phoebe Buckheister 2014-05-16  769   skb-mac_len = 
 ieee802154_hdr_push(skb, hdr);
 03556e4d Phoebe Buckheister 2014-05-16  770   skb_reset_mac_header(skb);
 03556e4d Phoebe Buckheister 2014-05-16  771  
 03556e4d Phoebe Buckheister 2014-05-16  772   rc = llsec_do_encrypt(skb, sec, 
 hdr, key);
 03556e4d Phoebe Buckheister 2014-05-16  773   llsec_key_put(key);
 03556e4d Phoebe Buckheister 2014-05-16  774  
 03556e4d Phoebe Buckheister 2014-05-16  775   return rc  0 ? rc : 0;

Btw, why would llsec_do_encrypt() return positive values here?  This
code is not documented at all.

regards,
dan carpenter

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


[kbuild] [net:master 54/56] net/vmw_vsock/af_vsock.c:1978 __vsock_core_init() warn: inconsistent returns mutex:vsock_register_mutex: locked (1952 [(-2)]) unlocked (1933 [(-4095)-(-1)], 1969 [0], 1978

2014-05-20 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head:   9becd707841207652449a8dfd90fe9c476d88546
commit: 2c4a336e0a3e203fab6aa8d8f7bb70a0ad968a6b [54/56] vsock: Make transport 
the proto owner

net/vmw_vsock/af_vsock.c:1978 __vsock_core_init() warn: inconsistent returns 
mutex:vsock_register_mutex: locked (1952 [(-2)]) unlocked (1933 
[(-4095)-(-1)], 1969 [0], 1978 [s32min-(-1),1-s32max], 1978 [(-16)])

git remote add net git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
git remote update net
git checkout 2c4a336e0a3e203fab6aa8d8f7bb70a0ad968a6b
vim +1978 net/vmw_vsock/af_vsock.c

d021c344 Andy King 2013-02-06  1962 if (err) {
d021c344 Andy King 2013-02-06  1963 pr_err(could not register 
af_vsock (%d) address family: %d\n,
d021c344 Andy King 2013-02-06  1964AF_VSOCK, err);
d021c344 Andy King 2013-02-06  1965 goto err_unregister_proto;
d021c344 Andy King 2013-02-06  1966 }
d021c344 Andy King 2013-02-06  1967  
2c4a336e Andy King 2014-05-01  1968 mutex_unlock(vsock_register_mutex);
d021c344 Andy King 2013-02-06  1969 return 0;
d021c344 Andy King 2013-02-06  1970  
d021c344 Andy King 2013-02-06  1971  err_unregister_proto:
d021c344 Andy King 2013-02-06  1972 proto_unregister(vsock_proto);
d021c344 Andy King 2013-02-06  1973  err_misc_deregister:
d021c344 Andy King 2013-02-06  1974 misc_deregister(vsock_device);
2c4a336e Andy King 2014-05-01  1975 transport = NULL;
2c4a336e Andy King 2014-05-01  1976  err_busy:
d021c344 Andy King 2013-02-06  1977 mutex_unlock(vsock_register_mutex);
2c4a336e Andy King 2014-05-01 @1978 return err;
d021c344 Andy King 2013-02-06  1979  }
2c4a336e Andy King 2014-05-01  1980  EXPORT_SYMBOL_GPL(__vsock_core_init);
d021c344 Andy King 2013-02-06  1981  
d021c344 Andy King 2013-02-06  1982  void vsock_core_exit(void)
d021c344 Andy King 2013-02-06  1983  {
d021c344 Andy King 2013-02-06  1984 mutex_lock(vsock_register_mutex);
d021c344 Andy King 2013-02-06  1985  
d021c344 Andy King 2013-02-06  1986 misc_deregister(vsock_device);

---
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] [linuxtv-samsung:for-v3.16 45/81] drivers/media/dvb-frontends/si2168.c:47 si2168_cmd_execute() warn: add some parenthesis here?

2014-05-20 Thread Dan Carpenter
On Mon, May 05, 2014 at 11:52:46PM +0300, Antti Palosaari wrote:
 845f3505 Antti Palosaari 2014-04-10  46
 845f3505 Antti Palosaari 2014-04-10 @47  if (!(cmd-args[0]  
 7)  0x01) {
 
 This should be:  if 
 (!((md-args[0]  7)  0x01)) {
 Otherwise it is a precedence error where it does the negate before the
 bitwise AND.
 
 That was already on my TODO list as daily media build test sparse
 warned it already http://hverkuil.home.xs4all.nl/logs/Monday.log
 
 I am waiting for media/master kernel upgrades from 3.15-rc1 as that
 kernel will hang whole machine when em28xx driver used (em28xx
 driver is USB bridge for those si2168 and si2157).
 

Wait, what?  This is a one liner.  I haven't understood the connection
with 3.15-rc1?

regards,
dan carpenter

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


[kbuild] [scsi:for-next 82/88] drivers/scsi/hpsa.c:3038 hpsa_update_scsi_devices() warn: impossible condition '(rescan_hba_mode 0) = (0-255 0)'

2014-05-21 Thread Dan Carpenter

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
head:   0a8c8edf3a8c8c878c1e92ddb9c9df966b2fdefb
commit: 96444fbbbf3b55a9cd1e337cc5c8c7d04bb364b7 [82/88] hpsa: do not ignore 
failure of sense controller parameters command

New smatch warnings:
drivers/scsi/hpsa.c:3038 hpsa_update_scsi_devices() warn: impossible condition 
'(rescan_hba_mode  0) = (0-255  0)'

Old smatch warnings:
drivers/scsi/hpsa.c:1042 hpsa_scsi_remove_entry() error: buffer overflow 
'h-dev' 2081 = 2081
drivers/scsi/hpsa.c:1192 hpsa_show_volume_status() warn: impossible condition 
'(sd-volume_offline == -1) = (0-255 == (-1))'
drivers/scsi/hpsa.c:2432 hpsa_get_device_id() warn: returning -1 instead of 
-ENOMEM is sloppy

git remote add scsi git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
git remote update scsi
git checkout 96444fbbbf3b55a9cd1e337cc5c8c7d04bb364b7
vim +3038 drivers/scsi/hpsa.c

339b2b14 Stephen M. Cameron 2010-02-04  3022int raid_ctlr_position;
316b221a Stephen M. Cameron 2014-02-21  3023u8 rescan_hba_mode;
aca4a520 Scott Teel 2012-01-19  3024DECLARE_BITMAP(lunzerobits, 
MAX_EXT_TARGETS);
edd16368 Stephen M. Cameron 2009-12-08  3025  
cfe5badc Scott Teel 2011-10-26  3026currentsd = 
kzalloc(sizeof(*currentsd) * HPSA_MAX_DEVICES, GFP_KERNEL);
edd16368 Stephen M. Cameron 2009-12-08  3027physdev_list = 
kzalloc(reportlunsize, GFP_KERNEL);
edd16368 Stephen M. Cameron 2009-12-08  3028logdev_list = 
kzalloc(reportlunsize, GFP_KERNEL);
edd16368 Stephen M. Cameron 2009-12-08  3029tmpdevice = 
kzalloc(sizeof(*tmpdevice), GFP_KERNEL);
edd16368 Stephen M. Cameron 2009-12-08  3030  
0b0e1d6c Stephen M. Cameron 2011-08-09  3031if (!currentsd || !physdev_list 
|| !logdev_list || !tmpdevice) {
edd16368 Stephen M. Cameron 2009-12-08  3032dev_err(h-pdev-dev, 
out of memory\n);
edd16368 Stephen M. Cameron 2009-12-08  3033goto out;
edd16368 Stephen M. Cameron 2009-12-08  3034}
edd16368 Stephen M. Cameron 2009-12-08  3035memset(lunzerobits, 0, 
sizeof(lunzerobits));
edd16368 Stephen M. Cameron 2009-12-08  3036  
316b221a Stephen M. Cameron 2014-02-21  3037rescan_hba_mode = 
hpsa_hba_mode_enabled(h);
96444fbb Joe Handzik2014-05-15 @3038if (rescan_hba_mode  0)
96444fbb Joe Handzik2014-05-15  3039goto out;
316b221a Stephen M. Cameron 2014-02-21  3040  
316b221a Stephen M. Cameron 2014-02-21  3041if (!h-hba_mode_enabled  
rescan_hba_mode)
316b221a Stephen M. Cameron 2014-02-21  3042dev_warn(h-pdev-dev, 
HBA mode enabled\n);
316b221a Stephen M. Cameron 2014-02-21  3043else if (h-hba_mode_enabled  
!rescan_hba_mode)
316b221a Stephen M. Cameron 2014-02-21  3044dev_warn(h-pdev-dev, 
HBA mode disabled\n);
316b221a Stephen M. Cameron 2014-02-21  3045  
316b221a Stephen M. Cameron 2014-02-21  3046h-hba_mode_enabled = 
rescan_hba_mode;

---
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 756/758] drivers/net/can/usb/gs_usb.c:830 gs_destroy_candev() error: dereferencing freed memory 'dev'

2014-05-21 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   2a7ede540785cac631a7e7334701a25e949853a8
commit: d08e973a77d128b25e01a08c34d89593fdf222da [756/758] can: gs_usb: Added 
support for the GS_USB CAN devices

drivers/net/can/usb/gs_usb.c:830 gs_destroy_candev() error: dereferencing freed 
memory 'dev'
drivers/net/can/usb/gs_usb.c:903 gs_usb_probe() error: potential null 
dereference 'dev'.  (kzalloc returns null)

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 d08e973a77d128b25e01a08c34d89593fdf222da
vim +/dev +830 drivers/net/can/usb/gs_usb.c

d08e973a Maximilian Schneider 2013-12-24  824  
d08e973a Maximilian Schneider 2013-12-24  825  static void 
gs_destroy_candev(struct gs_can *dev)
d08e973a Maximilian Schneider 2013-12-24  826  {
d08e973a Maximilian Schneider 2013-12-24  827   unregister_candev(dev-netdev);
d08e973a Maximilian Schneider 2013-12-24  828   free_candev(dev-netdev);
d08e973a Maximilian Schneider 2013-12-24  829   kfree(dev);
d08e973a Maximilian Schneider 2013-12-24 @830   
usb_kill_anchored_urbs(dev-tx_submitted);
d08e973a Maximilian Schneider 2013-12-24  831  }
d08e973a Maximilian Schneider 2013-12-24  832  
d08e973a Maximilian Schneider 2013-12-24  833  static int gs_usb_probe(struct 
usb_interface *intf, const struct usb_device_id *id)
d08e973a Maximilian Schneider 2013-12-24  834  {
d08e973a Maximilian Schneider 2013-12-24  835   struct gs_usb *dev;
d08e973a Maximilian Schneider 2013-12-24  836   int rc = -ENOMEM;
d08e973a Maximilian Schneider 2013-12-24  837   unsigned int icount, i;
d08e973a Maximilian Schneider 2013-12-24  838   struct gs_host_config *hconf;
d08e973a Maximilian Schneider 2013-12-24  839   struct gs_device_config *dconf;
d08e973a Maximilian Schneider 2013-12-24  840  
d08e973a Maximilian Schneider 2013-12-24  841   hconf = kmalloc(sizeof(*hconf), 
GFP_KERNEL);
d08e973a Maximilian Schneider 2013-12-24  842   if (!hconf)
d08e973a Maximilian Schneider 2013-12-24  843   return -ENOMEM;
d08e973a Maximilian Schneider 2013-12-24  844  
d08e973a Maximilian Schneider 2013-12-24  845   hconf-byte_order = 0xbeef;
d08e973a Maximilian Schneider 2013-12-24  846  
d08e973a Maximilian Schneider 2013-12-24  847   /* send host config */
d08e973a Maximilian Schneider 2013-12-24  848   rc = 
usb_control_msg(interface_to_usbdev(intf),
d08e973a Maximilian Schneider 2013-12-24  849
usb_sndctrlpipe(interface_to_usbdev(intf), 0),
d08e973a Maximilian Schneider 2013-12-24  850
GS_USB_BREQ_HOST_FORMAT,
d08e973a Maximilian Schneider 2013-12-24  851
USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
d08e973a Maximilian Schneider 2013-12-24  8521,
d08e973a Maximilian Schneider 2013-12-24  853
intf-altsetting[0].desc.bInterfaceNumber,
d08e973a Maximilian Schneider 2013-12-24  854hconf,
d08e973a Maximilian Schneider 2013-12-24  855
sizeof(*hconf),
d08e973a Maximilian Schneider 2013-12-24  8561000);
d08e973a Maximilian Schneider 2013-12-24  857  
d08e973a Maximilian Schneider 2013-12-24  858   kfree(hconf);
d08e973a Maximilian Schneider 2013-12-24  859  
d08e973a Maximilian Schneider 2013-12-24  860   if (rc  0) {
d08e973a Maximilian Schneider 2013-12-24  861   dev_err(intf-dev, 
Couldn't send data format (err=%d)\n,
d08e973a Maximilian Schneider 2013-12-24  862   rc);
d08e973a Maximilian Schneider 2013-12-24  863   return rc;
d08e973a Maximilian Schneider 2013-12-24  864   }
d08e973a Maximilian Schneider 2013-12-24  865  
d08e973a Maximilian Schneider 2013-12-24  866   dconf = kmalloc(sizeof(*dconf), 
GFP_KERNEL);
d08e973a Maximilian Schneider 2013-12-24  867   if (!dconf)
d08e973a Maximilian Schneider 2013-12-24  868   return -ENOMEM;
d08e973a Maximilian Schneider 2013-12-24  869  
d08e973a Maximilian Schneider 2013-12-24  870   /* read device config */
d08e973a Maximilian Schneider 2013-12-24  871   rc = 
usb_control_msg(interface_to_usbdev(intf),
d08e973a Maximilian Schneider 2013-12-24  872
usb_rcvctrlpipe(interface_to_usbdev(intf), 0),
d08e973a Maximilian Schneider 2013-12-24  873
GS_USB_BREQ_DEVICE_CONFIG,
d08e973a Maximilian Schneider 2013-12-24  874
USB_DIR_IN|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
d08e973a Maximilian Schneider 2013-12-24  8751,
d08e973a Maximilian Schneider 2013-12-24  876
intf-altsetting[0].desc.bInterfaceNumber,
d08e973a Maximilian Schneider 2013-12-24  877dconf,
d08e973a Maximilian Schneider 2013-12-24  878
sizeof(*dconf),
d08e973a Maximilian Schneider 2013-12-24  8791000);
d08e973a Maximilian Schneider 2013-12-24  880   if (rc  

Re: [kbuild] [scsi:for-next 82/88] drivers/scsi/hpsa.c:3038 hpsa_update_scsi_devices() warn: impossible condition '(rescan_hba_mode 0) = (0-255 0)'

2014-05-21 Thread Dan Carpenter
On Wed, May 21, 2014 at 09:55:33AM -0500, scame...@beardog.cce.hp.com wrote:
  Old smatch warnings:
  drivers/scsi/hpsa.c:1042 hpsa_scsi_remove_entry() error: buffer overflow 
  'h-dev' 2081 = 2081
 
 ^^^ Regarding this particular error, I think this may be a false
 positive, or at least I cannot see where the problem lies this morning.
 
 The code in question:
 
 /* Remove an entry from h-dev[] array. */
 static void hpsa_scsi_remove_entry(struct ctlr_info *h, int hostno, int entry,
   struct hpsa_scsi_dev_t *removed[], int *nremoved)
 {
   /* assumes h-devlock is held */
   int i;
   struct hpsa_scsi_dev_t *sd;
 
   BUG_ON(entry  0 || entry = HPSA_MAX_DEVICES);

Let's assume entry == HPSA_MAX_DEVICES - 1.

 
   sd = h-dev[entry];
   removed[*nremoved] = h-dev[entry];
   (*nremoved)++;
 
   for (i = entry; i  h-ndevices-1; i++)
   h-dev[i] = h-dev[i+1];  - this is the line it is 
 complaining about.
   ^^^

It is complaining about this.  Smatch isn't sure what the maximum value
of h-ndevices is but hopefully by this time next year it will be able
to understand hpsa_scsi_add_entry() and set it correctly.

regards,
dan carpenter


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


[kbuild] [ext4:dev 21/25] fs/ext4/extents.c:5442:2-8: preceding lock on line 5421

2014-05-26 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
head:   30f902f3886fbefe89641e9edc06d1f0e2fc2280
commit: 00532604c72e159a6d7b28b9bc9f7e364e396bee [21/25] ext4: introduce new 
i_write_mutex to protect fallocate

 fs/ext4/extents.c:5442:2-8: preceding lock on line 5421

git remote add ext4 git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git
git remote update ext4
git checkout 00532604c72e159a6d7b28b9bc9f7e364e396bee
vim +5442 fs/ext4/extents.c

0a04b248 Namjae Jeon 2014-04-19  5415  
9eb79482 Namjae Jeon 2014-02-23  5416   trace_ext4_collapse_range(inode, 
offset, len);
9eb79482 Namjae Jeon 2014-02-23  5417  
9eb79482 Namjae Jeon 2014-02-23  5418   punch_start = offset  
EXT4_BLOCK_SIZE_BITS(sb);
9eb79482 Namjae Jeon 2014-02-23  5419   punch_stop = (offset + len)  
EXT4_BLOCK_SIZE_BITS(sb);
9eb79482 Namjae Jeon 2014-02-23  5420  
00532604 Namjae Jeon 2014-05-26 @5421   
mutex_lock(EXT4_I(inode)-i_write_mutex);
00532604 Namjae Jeon 2014-05-26  5422  
1ce01c4a Namjae Jeon 2014-04-10  5423   /* Call ext4_force_commit to flush all 
data in case of data=journal. */
1ce01c4a Namjae Jeon 2014-04-10  5424   if (ext4_should_journal_data(inode)) {
1ce01c4a Namjae Jeon 2014-04-10  5425   ret = 
ext4_force_commit(inode-i_sb);
00532604 Namjae Jeon 2014-05-26  5426   if (ret) {
00532604 Namjae Jeon 2014-05-26  5427   
mutex_unlock(EXT4_I(inode)-i_write_mutex);
1ce01c4a Namjae Jeon 2014-04-10  5428   return ret;
00532604 Namjae Jeon 2014-05-26  5429   }
1ce01c4a Namjae Jeon 2014-04-10  5430   }
1ce01c4a Namjae Jeon 2014-04-10  5431  
a8680e0d Namjae Jeon 2014-04-19  5432   /*
a8680e0d Namjae Jeon 2014-04-19  5433* Need to round down offset to be 
aligned with page size boundary
a8680e0d Namjae Jeon 2014-04-19  5434* for page size  block size.
a8680e0d Namjae Jeon 2014-04-19  5435*/
a8680e0d Namjae Jeon 2014-04-19  5436   ioffset = round_down(offset, PAGE_SIZE);
a8680e0d Namjae Jeon 2014-04-19  5437  
9eb79482 Namjae Jeon 2014-02-23  5438   /* Write out all dirty pages */
a8680e0d Namjae Jeon 2014-04-19  5439   ret = 
filemap_write_and_wait_range(inode-i_mapping, ioffset,
a8680e0d Namjae Jeon 2014-04-19  5440  
LLONG_MAX);
9eb79482 Namjae Jeon 2014-02-23  5441   if (ret)
9eb79482 Namjae Jeon 2014-02-23 @5442   return ret;
9eb79482 Namjae Jeon 2014-02-23  5443  
9eb79482 Namjae Jeon 2014-02-23  5444   /* Take mutex lock */
9eb79482 Namjae Jeon 2014-02-23  5445   mutex_lock(inode-i_mutex);

---
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] [sound:topic/firewire 18/49] sound/firewire/amdtp.c:199:29: sparse: cannot size expression

2014-05-27 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git 
topic/firewire
head:   9b1ee0b2cb8bffdbb3003b1d5205f3ae0592c15a
commit: 1017abed18ae7087e7f3e256c48421d09d83176e [18/49] ALSA: firewire-lib: 
Add some AV/C general commands
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

 sound/firewire/amdtp.c:199:29: sparse: cannot size expression

git remote add sound 
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
git remote update sound
git checkout 1017abed18ae7087e7f3e256c48421d09d83176e
vim +199 sound/firewire/amdtp.c

31ef9134 Clemens Ladisch  2011-03-15  183   * changed while the stream is 
running.
31ef9134 Clemens Ladisch  2011-03-15  184   */
be4a2894 Takashi Sakamoto 2014-04-25  185  void 
amdtp_stream_set_parameters(struct amdtp_stream *s,
be4a2894 Takashi Sakamoto 2014-04-25  186
unsigned int rate,
be4a2894 Takashi Sakamoto 2014-04-25  187
unsigned int pcm_channels,
be4a2894 Takashi Sakamoto 2014-04-25  188
unsigned int midi_ports)
31ef9134 Clemens Ladisch  2011-03-15  189  {
77d2a8a4 Takashi Sakamoto 2014-04-25  190   unsigned int i, sfc, 
midi_channels;
31ef9134 Clemens Ladisch  2011-03-15  191  
83d8d72d Takashi Sakamoto 2014-04-25  192   midi_channels = 
DIV_ROUND_UP(midi_ports, 8);
83d8d72d Takashi Sakamoto 2014-04-25  193  
77d2a8a4 Takashi Sakamoto 2014-04-25  194   if 
(WARN_ON(amdtp_stream_running(s)) |
77d2a8a4 Takashi Sakamoto 2014-04-25  195   WARN_ON(pcm_channels  
AMDTP_MAX_CHANNELS_FOR_PCM) |
83d8d72d Takashi Sakamoto 2014-04-25  196   WARN_ON(midi_channels  
AMDTP_MAX_CHANNELS_FOR_MIDI))
31ef9134 Clemens Ladisch  2011-03-15  197   return;
31ef9134 Clemens Ladisch  2011-03-15  198  
1017abed Takashi Sakamoto 2014-04-25 @199   for (sfc = 0; sfc  
sizeof(amdtp_rate_table); ++sfc)

The warning seems to be caused by a problem in sparse but anyway, this
should be sfc  ARRAY_SIZE(amdtp_rate_table) instead of sizeof().  The
amdtp_rate_table[] array holds integers so sizeof() is 4x larger than
we want.

1017abed Takashi Sakamoto 2014-04-25  200   if 
(amdtp_rate_table[sfc] == rate)
e84d15f6 Clemens Ladisch  2011-09-04  201   goto sfc_found;
31ef9134 Clemens Ladisch  2011-03-15  202   WARN_ON(1);
e84d15f6 Clemens Ladisch  2011-09-04  203   return;
e84d15f6 Clemens Ladisch  2011-09-04  204  
e84d15f6 Clemens Ladisch  2011-09-04  205  sfc_found:
10550bea Takashi Sakamoto 2014-04-25  206   s-pcm_channels = pcm_channels;
e84d15f6 Clemens Ladisch  2011-09-04  207   s-sfc = sfc;

---
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] [usb:usb-next 146/160] drivers/usb/host/max3421-hcd.c:594 max3421_next_transfer() warn: variable dereferenced before check 'urb' (see line 591)

2014-05-27 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next
head:   112fe8e290d9b1c8651de6c7d010041f0ff44b6d
commit: 2d53139f31626bad6f8983d8e519ddde2cbba921 [146/160] Add support for 
using a MAX3421E chip as a host driver.

drivers/usb/host/max3421-hcd.c:594 max3421_next_transfer() warn: variable 
dereferenced before check 'urb' (see line 591)
drivers/usb/host/max3421-hcd.c:1563 max3421_urb_enqueue() warn: inconsistent 
returns spin_lock:max3421_hcd-lock: locked (1547 [(-12)]) unlocked (1534 
[(-22)], 1563 [0], 1563 [s32min-(-1),1-s32max])
drivers/usb/host/max3421-hcd.c:1563 max3421_urb_enqueue() warn: inconsistent 
returns irqsave:flags: locked (1547 [(-12)]) unlocked (1534 [(-22)], 1563 [0], 
1563 [s32min-(-1),1-s32max])

git remote add usb git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
git remote update usb
git checkout 2d53139f31626bad6f8983d8e519ddde2cbba921
vim +/urb +594 drivers/usb/host/max3421-hcd.c

2d53139f David Mosberger 2014-04-28  585   */
2d53139f David Mosberger 2014-04-28  586  static void
2d53139f David Mosberger 2014-04-28  587  max3421_next_transfer(struct usb_hcd 
*hcd, int fast_retransmit)
2d53139f David Mosberger 2014-04-28  588  {
2d53139f David Mosberger 2014-04-28  589struct max3421_hcd *max3421_hcd 
= hcd_to_max3421(hcd);
2d53139f David Mosberger 2014-04-28  590struct urb *urb = 
max3421_hcd-curr_urb;
2d53139f David Mosberger 2014-04-28 @591struct max3421_ep *max3421_ep = 
urb-ep-hcpriv;
2d53139f David Mosberger 2014-04-28  592int cmd = -EINVAL;
2d53139f David Mosberger 2014-04-28  593  
2d53139f David Mosberger 2014-04-28 @594if (!urb)
2d53139f David Mosberger 2014-04-28  595return; /* nothing to 
do */
2d53139f David Mosberger 2014-04-28  596  
2d53139f David Mosberger 2014-04-28  597switch (max3421_ep-pkt_state) {

---
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] [btrfs:integration 56/62] fs/btrfs/disk-io.c:2601:7-29: duplicated argument to or ||

2014-05-28 Thread Dan Carpenter
TO: Chris Mason chris.ma...@fusionio.com

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git 
integration
head:   155850c10bdead0095983733158e997d57b674cc
commit: 90f48400f4b06947076d291cf11b8e30a295defc [56/62] Btrfs: async delayed 
refs

 fs/btrfs/disk-io.c:2601:7-29: duplicated argument to  or ||

git remote add btrfs 
git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git
git remote update btrfs
git checkout 90f48400f4b06947076d291cf11b8e30a295defc
vim +2601 fs/btrfs/disk-io.c

736cfa15e Qu Wenruo2014-02-28  2585 fs_info-readahead_workers =
736cfa15e Qu Wenruo2014-02-28  2586 
btrfs_alloc_workqueue(readahead, flags, max_active, 2);
fc97fab0e Qu Wenruo2014-02-28  2587 fs_info-qgroup_rescan_workers =
fc97fab0e Qu Wenruo2014-02-28  2588 
btrfs_alloc_workqueue(qgroup-rescan, flags, 1, 0);
90f48400f Chris Mason  2014-05-22  2589 fs_info-extent_workers =
90f48400f Chris Mason  2014-05-22  2590 
btrfs_alloc_workqueue(extent-refs, flags,
90f48400f Chris Mason  2014-05-22  2591   
min_t(u64, fs_devices-num_devices,
90f48400f Chris Mason  2014-05-22  2592 
max_active), 8);
61b494401 Chris Mason  2008-07-31  2593  
a8c93d4ef Qu Wenruo2014-02-28  2594 if (!(fs_info-workers  
fs_info-delalloc_workers 
fccb5d86d Qu Wenruo2014-02-28  2595   fs_info-submit_workers 
 fs_info-flush_workers 
fccb5d86d Qu Wenruo2014-02-28  2596   fs_info-endio_workers  
fs_info-endio_meta_workers 
fccb5d86d Qu Wenruo2014-02-28  2597   
fs_info-endio_meta_write_workers 
fccb5d86d Qu Wenruo2014-02-28  2598   
fs_info-endio_write_workers  fs_info-endio_raid56_workers 
e66f0bb14 Qu Wenruo2014-02-28  2599   
fs_info-endio_freespace_worker  fs_info-rmw_workers 
dc6e32099 Qu Wenruo2014-02-28  2600   fs_info-caching_workers 
 fs_info-readahead_workers 
fc97fab0e Qu Wenruo2014-02-28 @2601   fs_info-fixup_workers  
fs_info-delayed_workers 
90f48400f Chris Mason  2014-05-22  2602   fs_info-fixup_workers  
fs_info-extent_workers 
fc97fab0e Qu Wenruo2014-02-28  2603   
fs_info-qgroup_rescan_workers)) {
fed425c74 Ilya Dryomov 2012-06-22  2604 err = -ENOMEM;
0dc3b84a7 Josef Bacik  2011-11-18  2605 goto fail_sb_buffer;
0dc3b84a7 Josef Bacik  2011-11-18  2606 }
4543df7ec Chris Mason  2008-06-11  2607  
4575c9cce Chris Mason  2008-04-18  2608 fs_info-bdi.ra_pages *= 
btrfs_super_num_devices(disk_super);
c8b978188 Chris Mason  2008-10-29  2609 fs_info-bdi.ra_pages = 
max(fs_info-bdi.ra_pages,

---
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] [staging:staging-next 404/486] drivers/staging/vt6656/rf.c:1060 vnt_rf_table_download() error: __builtin_memcpy() 'addr2' too small (3 vs 64)

2014-05-28 Thread Dan Carpenter
[ This is really an old warning that got bumped to new because of the
  rename.  Anyway, it's a real bug.  -dan ]

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-next
head:   f9de4a30a5e647bff71509d6f5d419f6967ba291
commit: c49d7550e5fa85f2b592594f4c1867550b80835a [404/486] staging: vt6656: 
rf.c rename RFbRFTableDownload to vnt_rf_table_download.

drivers/staging/vt6656/rf.c:1060 vnt_rf_table_download() error: 
__builtin_memcpy() 'addr2' too small (3 vs 64)
drivers/staging/vt6656/rf.c:1078 vnt_rf_table_download() error: 
__builtin_memcpy() 'addr3' too small (3 vs 64)
drivers/staging/vt6656/rf.c:1094 vnt_rf_table_download() error: 
__builtin_memcpy() 'addr1' too small (3 vs 48)
drivers/staging/vt6656/rf.c:1108 vnt_rf_table_download() error: 
__builtin_memcpy() 'addr2' too small (3 vs 64)

git remote add staging 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
git remote update staging
git checkout c49d7550e5fa85f2b592594f4c1867550b80835a
vim +/addr2 +1060 drivers/staging/vt6656/rf.c

d9652aef Malcolm Priestley 2013-05-27  1054 while (length2  0) {
d9652aef Malcolm Priestley 2013-05-27  1055 if (length2 = 64)
d9652aef Malcolm Priestley 2013-05-27  1056 length = 64;
d9652aef Malcolm Priestley 2013-05-27  1057 else
d9652aef Malcolm Priestley 2013-05-27  1058 length = 
length2;
d9652aef Malcolm Priestley 2013-05-27  1059  
d9652aef Malcolm Priestley 2013-05-27 @1060 memcpy(array, addr2, 
length);
d9652aef Malcolm Priestley 2013-05-27  1061  
1390b02a Malcolm Priestley 2014-05-26  1062 vnt_control_out(priv, 
MESSAGE_TYPE_WRITE,
d9652aef Malcolm Priestley 2013-05-27  1063 value, 
MESSAGE_REQUEST_RF_CH0, length, array);
d9652aef Malcolm Priestley 2013-05-27  1064  
d9652aef Malcolm Priestley 2013-05-27  1065 length2 -= length;
d9652aef Malcolm Priestley 2013-05-27  1066 value += length;
d9652aef Malcolm Priestley 2013-05-27  1067 addr2 += length;
d9652aef Malcolm Priestley 2013-05-27  1068 }
d9652aef Malcolm Priestley 2013-05-27  1069  
d9652aef Malcolm Priestley 2013-05-27  1070 /* Channel table 1 */
d9652aef Malcolm Priestley 2013-05-27  1071 value = 0;
d9652aef Malcolm Priestley 2013-05-27  1072 while (length3  0) {
d9652aef Malcolm Priestley 2013-05-27  1073 if (length3 = 64)
d9652aef Malcolm Priestley 2013-05-27  1074 length = 64;
d9652aef Malcolm Priestley 2013-05-27  1075 else
d9652aef Malcolm Priestley 2013-05-27  1076 length = 
length3;
d9652aef Malcolm Priestley 2013-05-27  1077  
d9652aef Malcolm Priestley 2013-05-27 @1078 memcpy(array, addr3, 
length);
d9652aef Malcolm Priestley 2013-05-27  1079  
1390b02a Malcolm Priestley 2014-05-26  1080 vnt_control_out(priv, 
MESSAGE_TYPE_WRITE,
d9652aef Malcolm Priestley 2013-05-27  1081 value, 
MESSAGE_REQUEST_RF_CH1, length, array);
d9652aef Malcolm Priestley 2013-05-27  1082  
d9652aef Malcolm Priestley 2013-05-27  1083 length3 -= length;
d9652aef Malcolm Priestley 2013-05-27  1084 value += length;
d9652aef Malcolm Priestley 2013-05-27  1085 addr3 += length;
d9652aef Malcolm Priestley 2013-05-27  1086 }
d9652aef Malcolm Priestley 2013-05-27  1087  
d9652aef Malcolm Priestley 2013-05-27  1088 if (priv-byRFType == 
RF_AIROHA7230) {
d9652aef Malcolm Priestley 2013-05-27  1089 length1 = 
CB_AL7230_INIT_SEQ * 3;
d9652aef Malcolm Priestley 2013-05-27  1090 length2 = 
CB_MAX_CHANNEL * 3;
78a650dc Malcolm Priestley 2013-05-27  1091 addr1 = 
(al7230_init_table_amode[0][0]);
78a650dc Malcolm Priestley 2013-05-27  1092 addr2 = 
(al7230_channel_table2[0][0]);
d9652aef Malcolm Priestley 2013-05-27  1093  
d9652aef Malcolm Priestley 2013-05-27 @1094 memcpy(array, addr1, 
length1);
d9652aef Malcolm Priestley 2013-05-27  1095  
d9652aef Malcolm Priestley 2013-05-27  1096 /* Init Table 2 */
1390b02a Malcolm Priestley 2014-05-26  1097 vnt_control_out(priv, 
MESSAGE_TYPE_WRITE,
d9652aef Malcolm Priestley 2013-05-27  1098 0, 
MESSAGE_REQUEST_RF_INIT2, length1, array);
d9652aef Malcolm Priestley 2013-05-27  1099  
d9652aef Malcolm Priestley 2013-05-27  1100 /* Channel Table 0 */
d9652aef Malcolm Priestley 2013-05-27  1101 value = 0;
d9652aef Malcolm Priestley 2013-05-27  1102 while (length2  0) {
d9652aef Malcolm Priestley 2013-05-27  1103 if (length2 = 
64)
d9652aef Malcolm Priestley 2013-05-27  1104 length 
= 64;
d9652aef Malcolm Priestley 2013-05-27  1105 else
d9652aef Malcolm Priestley 2013-05-27  1106 length 
= length2;
d9652aef Malcolm Priestley 2013-05-27  1107  
d9652aef Malcolm 

[kbuild] [nfs:devel 30/48] fs/nfs/pagelist.c:1037 __nfs_pageio_add_request() error: 'subreq' dereferencing possible ERR_PTR()

2014-05-29 Thread Dan Carpenter
tree:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git devel
head:   c75c3b0bfffdb21daecb7dadbd30eb2e353fe66d
commit: 89b576af8bc6fc7421ac09e246f6c3d9237fc9b8 [30/48] nfs: add support for 
multiple nfs reqs per page

fs/nfs/pagelist.c:1037 __nfs_pageio_add_request() error: 'subreq' dereferencing 
possible ERR_PTR()

git remote add nfs git://git.linux-nfs.org/projects/trondmy/linux-nfs.git
git remote update nfs
git checkout 89b576af8bc6fc7421ac09e246f6c3d9237fc9b8
vim +/subreq +1037 fs/nfs/pagelist.c

89b576af Weston Andros Adamson 2014-05-15  1021 }
89b576af Weston Andros Adamson 2014-05-15  1022  
89b576af Weston Andros Adamson 2014-05-15  1023 /* check for 
buggy pg_test call(s) */
89b576af Weston Andros Adamson 2014-05-15  1024 
WARN_ON_ONCE(subreq-wb_bytes + subreq-wb_pgbase  PAGE_SIZE);
89b576af Weston Andros Adamson 2014-05-15  1025 
WARN_ON_ONCE(subreq-wb_bytes  bytes_left);
89b576af Weston Andros Adamson 2014-05-15  1026 
WARN_ON_ONCE(subreq-wb_bytes == 0);
89b576af Weston Andros Adamson 2014-05-15  1027  
89b576af Weston Andros Adamson 2014-05-15  1028 bytes_left -= 
subreq-wb_bytes;
89b576af Weston Andros Adamson 2014-05-15  1029 offset += 
subreq-wb_bytes;
89b576af Weston Andros Adamson 2014-05-15  1030 pgbase += 
subreq-wb_bytes;
89b576af Weston Andros Adamson 2014-05-15  1031  
89b576af Weston Andros Adamson 2014-05-15  1032 if (bytes_left) 
{
89b576af Weston Andros Adamson 2014-05-15  1033 subreq 
= nfs_create_request(req-wb_context,
89b576af Weston Andros Adamson 2014-05-15  1034 
req-wb_page,
89b576af Weston Andros Adamson 2014-05-15  1035 
subreq, pgbase, bytes_left);
89b576af Weston Andros Adamson 2014-05-15  1036 
nfs_lock_request(subreq);
89b576af Weston Andros Adamson 2014-05-15 @1037 
subreq-wb_offset  = offset;
89b576af Weston Andros Adamson 2014-05-15  1038 
subreq-wb_index = req-wb_index;
89b576af Weston Andros Adamson 2014-05-15  1039 }
89b576af Weston Andros Adamson 2014-05-15  1040 } while (bytes_left  
0);
89b576af Weston Andros Adamson 2014-05-15  1041  
89b576af Weston Andros Adamson 2014-05-15  1042 
nfs_page_group_unlock(req);
bcb71bba Trond Myklebust   2007-04-02  1043 return 1;
bcb71bba Trond Myklebust   2007-04-02  1044  }
bcb71bba Trond Myklebust   2007-04-02  1045  

---
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] [mfleming:cqm/pj 3/7] include/linux/perf_event.h:59:30: sparse: marked inline, but without a definition

2014-05-29 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/linux.git cqm/pj
head:   20c8876174e697b30efb8f7e02420e99e893917c
commit: b531f858f8f20e73b0a70f1dbd5b856876bb335e [3/7] cgroup: Add new cacheqos 
cgroup subsys to support Cache QoS Monitoring
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

   kernel/sched/core.c:565:9: sparse: incompatible types in comparison 
expression (different address spaces)
   kernel/sched/core.c:1382:17: sparse: incompatible types in comparison 
expression (different address spaces)
 include/linux/perf_event.h:59:30: sparse: marked inline, but without a 
 definition
 include/linux/perf_event.h:58:31: sparse: marked inline, but without a 
 definition
   kernel/sched/core.c:4896:9: sparse: incompatible types in comparison 
expression (different address spaces)
   kernel/sched/core.c:4903:9: sparse: incompatible types in comparison 
expression (different address spaces)
   kernel/sched/sched.h:723:9: sparse: incompatible types in comparison 
expression (different address spaces)
   kernel/sched/sched.h:736:9: sparse: incompatible types in comparison 
expression (different address spaces)
   kernel/sched/sched.h:723:9: sparse: incompatible types in comparison 
expression (different address spaces)

git remote add mfleming 
git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/linux.git
git remote update mfleming
git checkout b531f858f8f20e73b0a70f1dbd5b856876bb335e
vim +59 include/linux/perf_event.h

60063497a include/linux/perf_event.h   Arun Sharma   2011-07-26  52  
#include linux/atomic.h
641cc9388 include/linux/perf_event.h   Jiri Olsa 2012-03-15  53  
#include linux/sysfs.h
4018994f3 include/linux/perf_event.h   Jiri Olsa 2012-08-07  54  
#include linux/perf_regs.h
fa5881514 include/linux/perf_event.h   Peter Zijlstra2010-05-18  55  
#include asm/local.h
f3dfd2656 include/linux/perf_counter.h Paul Mackerras2009-02-26  56  
b531f858f include/linux/perf_event.h   Peter P Waskiewicz Jr 2014-01-03  57  
#ifdef CONFIG_CGROUP_CACHEQOS
b531f858f include/linux/perf_event.h   Peter P Waskiewicz Jr 2014-01-03 @58  
inline void cacheqos_sched_out(struct task_struct *task);
b531f858f include/linux/perf_event.h   Peter P Waskiewicz Jr 2014-01-03 @59  
inline void cacheqos_sched_in(struct task_struct *task);
b531f858f include/linux/perf_event.h   Peter P Waskiewicz Jr 2014-01-03  60  
#endif /* CONFIG_CGROUP_CACHEQOS */
b531f858f include/linux/perf_event.h   Peter P Waskiewicz Jr 2014-01-03  61  
f9188e023 include/linux/perf_counter.h Peter Zijlstra2009-06-18  62  
struct perf_callchain_entry {

---
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] [mfleming:cqm/pj 3/7] kernel/sched/cacheqos.c:107:2-8: preceding lock on line 104

2014-05-30 Thread Dan Carpenter
Peter's email is bouncing.  Matt, can you take this one?

regards,
dan carpenter

On Fri, May 30, 2014 at 11:52:52AM +0300, Dan Carpenter wrote:
 tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/linux.git 
 cqm/pj
 head:   f2526b7e5c57b422fe3615aaeb637700cc0221f7
 commit: b531f858f8f20e73b0a70f1dbd5b856876bb335e [3/7] cgroup: Add new 
 cacheqos cgroup subsys to support Cache QoS Monitoring
 
  kernel/sched/cacheqos.c:107:2-8: preceding lock on line 104
 --
  arch/x86/kernel/cpu/perf_event_intel_uncore.c:1685:2-8: preceding lock on 
  line 1658
 
 git remote add mfleming 
 git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/linux.git
 git remote update mfleming
 git checkout b531f858f8f20e73b0a70f1dbd5b856876bb335e
 vim +107 kernel/sched/cacheqos.c
 
 b531f858 Peter P Waskiewicz Jr 2014-01-03   98  
 b531f858 Peter P Waskiewicz Jr 2014-01-03   99  static int 
 cacheqos_deallocate_rmid(struct cacheqos *cq)
 b531f858 Peter P Waskiewicz Jr 2014-01-03  100  {
 b531f858 Peter P Waskiewicz Jr 2014-01-03  101struct cacheqos 
 *cq_parent = parent_cacheqos(cq);
 b531f858 Peter P Waskiewicz Jr 2014-01-03  102int err;
 b531f858 Peter P Waskiewicz Jr 2014-01-03  103  
 b531f858 Peter P Waskiewicz Jr 2014-01-03 @104
 mutex_lock(cacheqos_mutex);
 b531f858 Peter P Waskiewicz Jr 2014-01-03  105err = 
 cacheqos_move_rmid_to_unused_list(cq);
 b531f858 Peter P Waskiewicz Jr 2014-01-03  106if (err)
 b531f858 Peter P Waskiewicz Jr 2014-01-03 @107return err;
 b531f858 Peter P Waskiewicz Jr 2014-01-03  108/* assign parent's rmid 
 to cgroup */
 b531f858 Peter P Waskiewicz Jr 2014-01-03  109cq-monitor_cache = 
 false;
 b531f858 Peter P Waskiewicz Jr 2014-01-03  110cq-rmid = 
 cq_parent-rmid;
 
 ---
 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 mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild


Re: [kbuild] [mfleming:cqm/pj 3/7] kernel/sched/cacheqos.c:107:2-8: preceding lock on line 104

2014-05-30 Thread Dan Carpenter
On Fri, May 30, 2014 at 10:18:29AM +0100, Fleming, Matt wrote:
 Yeah, this branch should really have experimental in the name to
 avoid the kbuild bot. My bad.

The build bot is great, though.  :)  Tiny bugs like this are easy to
fix.

regards,
dan carpenter

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


Re: [kbuild] [PATCH] staging: vt6656: Fix vnt_rf_table_download __builtin_memcpy() addr* too small (3 vs 64).

2014-05-31 Thread Dan Carpenter
On Sat, May 31, 2014 at 02:09:27PM +0100, Malcolm Priestley wrote:
 Fix following errors
 drivers/staging/vt6656/rf.c:1060 vnt_rf_table_download() error: 
 __builtin_memcpy() 'addr2' too small (3 vs 64)
 drivers/staging/vt6656/rf.c:1078 vnt_rf_table_download() error: 
 __builtin_memcpy() 'addr3' too small (3 vs 64)
 drivers/staging/vt6656/rf.c:1094 vnt_rf_table_download() error: 
 __builtin_memcpy() 'addr1' too small (3 vs 48)
 drivers/staging/vt6656/rf.c:1108 vnt_rf_table_download() error: 
 __builtin_memcpy() 'addr2' too small (3 vs 64)
 

I guess I was confused where the 64 comes from in the:

if (length2 = 64)
length = 64;

We only ever seem to use the first 64 bytes of u8 array[256]; so my
guess is that it was intended to be sizeof(array)?

regards,
dan carpenter

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


Re: [kbuild] [PATCH] staging: vt6656: Fix vnt_rf_table_download __builtin_memcpy() addr* too small (3 vs 64).

2014-05-31 Thread Dan Carpenter
On Sat, May 31, 2014 at 04:42:02PM +0300, Dan Carpenter wrote:
 On Sat, May 31, 2014 at 02:09:27PM +0100, Malcolm Priestley wrote:
  Fix following errors
  drivers/staging/vt6656/rf.c:1060 vnt_rf_table_download() error: 
  __builtin_memcpy() 'addr2' too small (3 vs 64)
  drivers/staging/vt6656/rf.c:1078 vnt_rf_table_download() error: 
  __builtin_memcpy() 'addr3' too small (3 vs 64)
  drivers/staging/vt6656/rf.c:1094 vnt_rf_table_download() error: 
  __builtin_memcpy() 'addr1' too small (3 vs 48)
  drivers/staging/vt6656/rf.c:1108 vnt_rf_table_download() error: 
  __builtin_memcpy() 'addr2' too small (3 vs 64)
  
 

Btw, the 3 here is a bug in Smatch...  I will fix that.  You shouldn't
have to work around that like this.  I'm sorry for the confusion.  My
only question when I reported the Smatch warning was about where we got
the 64.

regards,
dan carpenter

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


[kbuild] [ipvs-next:master 2/3] net/netfilter/nfnetlink_acct.c:90 nfnl_acct_new() warn: possible memory leak of 'nfacct'

2014-06-01 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next.git master
head:   f768e5bdefe1ec9adbf7a116dfb156b73cacb582
commit: 683399eddb9fff742b1a14c5a5d03e12bfc0afff [2/3] netfilter: 
nfnetlink_acct: Adding quota support to accounting framework

net/netfilter/nfnetlink_acct.c:90 nfnl_acct_new() warn: possible memory leak of 
'nfacct'
net/netfilter/nfnetlink_acct.c:92 nfnl_acct_new() warn: possible memory leak of 
'nfacct'
net/netfilter/nfnetlink_acct.c:94 nfnl_acct_new() warn: possible memory leak of 
'nfacct'
net/netfilter/nfnetlink_acct.c:99 nfnl_acct_new() warn: overwrite may leak 
'nfacct'

git remote add ipvs-next 
git://git.kernel.org/pub/scm/linux/kernel/git/horms/ipvs-next.git
git remote update ipvs-next
git checkout 683399eddb9fff742b1a14c5a5d03e12bfc0afff
vim +/nfacct +90 net/netfilter/nfnetlink_acct.c

94139027 Pablo Neira Ayuso 2011-12-23   84  }
94139027 Pablo Neira Ayuso 2011-12-23   85  
94139027 Pablo Neira Ayuso 2011-12-23   86  nfacct = kzalloc(sizeof(struct 
nf_acct), GFP_KERNEL);
683399ed Mathieu Poirier   2014-04-20   87  if (tb[NFACCT_FLAGS]) {
683399ed Mathieu Poirier   2014-04-20   88  flags = 
ntohl(nla_get_be32(tb[NFACCT_FLAGS]));
683399ed Mathieu Poirier   2014-04-20   89  if (flags  
~NFACCT_F_QUOTA)
683399ed Mathieu Poirier   2014-04-20  @90  return 
-EOPNOTSUPP;
683399ed Mathieu Poirier   2014-04-20   91  if ((flags  
NFACCT_F_QUOTA) == NFACCT_F_QUOTA)
683399ed Mathieu Poirier   2014-04-20  @92  return -EINVAL;
683399ed Mathieu Poirier   2014-04-20   93  if (flags  
NFACCT_F_OVERQUOTA)
683399ed Mathieu Poirier   2014-04-20  @94  return -EINVAL;
683399ed Mathieu Poirier   2014-04-20   95  
683399ed Mathieu Poirier   2014-04-20   96  size += sizeof(u64);
683399ed Mathieu Poirier   2014-04-20   97  }
683399ed Mathieu Poirier   2014-04-20   98  
683399ed Mathieu Poirier   2014-04-20  @99  nfacct = kzalloc(sizeof(struct 
nf_acct) + size, GFP_KERNEL);
94139027 Pablo Neira Ayuso 2011-12-23  100  if (nfacct == NULL)
94139027 Pablo Neira Ayuso 2011-12-23  101  return -ENOMEM;
94139027 Pablo Neira Ayuso 2011-12-23  102  

---
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] [slave-dma:for-linus 55/57] drivers/dma/sh/rcar-hpbdma.c:627:10-15: ERROR: iterator variable bound on line 626 cannot be NULL

2014-06-02 Thread Dan Carpenter
tree:   git://git.infradead.org/users/vkoul/slave-dma.git for-linus
head:   654fa24965aafcb4bb8a1a14400c5ecea3be76b6
commit: ebc6d2d9c8cd48c351da84dd467c0edddc149ded [55/57] dmaengine: shdma: 
Enable driver compilation with COMPILE_TEST

 drivers/dma/sh/rcar-hpbdma.c:627:10-15: ERROR: iterator variable bound on 
 line 626 cannot be NULL
--
 drivers/dma/sh/shdma-base.c:812:7-12: ERROR: iterator variable bound on line 
 808 cannot be NULL
--
 drivers/dma/sh/shdmac.c:581:10-15: ERROR: iterator variable bound on line 
 580 cannot be NULL
--
 drivers/dma/sh/sudmac.c:303:10-15: ERROR: iterator variable bound on line 
 302 cannot be NULL

Please consider folding the attached diff :-)

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
From: Fengguang Wu fengguang...@intel.com
Subject: [PATCH] dmaengine: shdma: fix coccinelle warnings
TO: Vinod Koul vinod.k...@intel.com
CC: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
CC: dmaeng...@vger.kernel.org 
CC: linux-ker...@vger.kernel.org 

drivers/dma/sh/rcar-hpbdma.c:627:10-15: ERROR: iterator variable bound on line 626 cannot be NULL

 Many iterators have the property that the first argument is always bound
 to a real list element, never NULL.

Semantic patch information:
 False positives arise for some iterators that do not have this property,
 or in cases when the loop cursor is reassigned.  The latter should only
 happen when the matched code is on the way to a loop exit (break, goto,
 or return).

Generated by: /kbuild/src/linux/scripts/coccinelle/iterators/itnull.cocci

CC: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
CC: Vinod Koul vinod.k...@intel.com
Signed-off-by: Fengguang Wu fengguang...@intel.com
---

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

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

--- a/drivers/dma/sh/rcar-hpbdma.c
+++ b/drivers/dma/sh/rcar-hpbdma.c
@@ -624,7 +624,7 @@ static void hpb_dmae_chan_remove(struct
 	int i;
 
 	shdma_for_each_chan(schan, hpbdev-shdma_dev, i) {
-		BUG_ON(!schan);
+		BUG_ON(BAD(!schan));
 
 		shdma_chan_remove(schan);
 	}
From: Fengguang Wu fengguang...@intel.com
Subject: [PATCH] dmaengine: shdma: fix coccinelle warnings
TO: Vinod Koul vinod.k...@intel.com
CC: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
CC: dmaeng...@vger.kernel.org 
CC: linux-ker...@vger.kernel.org 

drivers/dma/sh/shdma-base.c:812:7-12: ERROR: iterator variable bound on line 808 cannot be NULL

 Many iterators have the property that the first argument is always bound
 to a real list element, never NULL.

Semantic patch information:
 False positives arise for some iterators that do not have this property,
 or in cases when the loop cursor is reassigned.  The latter should only
 happen when the matched code is on the way to a loop exit (break, goto,
 or return).

Generated by: /kbuild/src/linux/scripts/coccinelle/iterators/itnull.cocci

CC: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
CC: Vinod Koul vinod.k...@intel.com
Signed-off-by: Fengguang Wu fengguang...@intel.com
---

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

 shdma-base.c |3 ---
 1 file changed, 3 deletions(-)

--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -809,9 +809,6 @@ bool shdma_reset(struct shdma_dev *sdev)
 		struct shdma_desc *sdesc;
 		LIST_HEAD(dl);
 
-		if (!schan)
-			continue;
-
 		spin_lock(schan-chan_lock);
 
 		/* Stop the channel */
From: Fengguang Wu fengguang...@intel.com
Subject: [PATCH] dmaengine: shdma: fix coccinelle warnings
TO: Vinod Koul vinod.k...@intel.com
CC: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
CC: dmaeng...@vger.kernel.org 
CC: linux-ker...@vger.kernel.org 
CC: devicet...@vger.kernel.org 

drivers/dma/sh/shdmac.c:581:10-15: ERROR: iterator variable bound on line 580 cannot be NULL

 Many iterators have the property that the first argument is always bound
 to a real list element, never NULL.

Semantic patch information:
 False positives arise for some iterators that do not have this property,
 or in cases when the loop cursor is reassigned.  The latter should only
 happen when the matched code is on the way to a loop exit (break, goto,
 or return).

Generated by: /kbuild/src/linux/scripts/coccinelle/iterators/itnull.cocci

CC: Laurent Pinchart laurent.pinchart+rene...@ideasonboard.com
CC: Vinod Koul vinod.k...@intel.com
Signed-off-by: Fengguang Wu fengguang...@intel.com
---

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

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

--- a/drivers/dma/sh/shdmac.c
+++ b/drivers/dma/sh/shdmac.c
@@ -578,7 +578,7 @@ static void sh_dmae_chan_remove(struct s
 	int i;
 
 	shdma_for_each_chan(schan, shdev-shdma_dev, i) {
-		BUG_ON(!schan);
+		BUG_ON(BAD(!schan));
 
 		shdma_chan_remove(schan);
 	}
From: Fengguang Wu 

[kbuild] [wsa:i2c/for-next 1/4] drivers/i2c/busses/i2c-rk3x.c:610:69-70: rk3x_i2c_match is not NULL terminated at line 610

2014-06-12 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux i2c/for-next
head:   c155ba884f68b5447529bc75bcb54e68130fd774
commit: c41aa3ce938b684d853f1004072b6116a41bb1ce [1/4] i2c: rk3x: add driver 
for Rockchip RK3xxx SoC I2C adapter

 drivers/i2c/busses/i2c-rk3x.c:610:69-70: rk3x_i2c_match is not NULL 
 terminated at line 610

Please consider folding the attached diff :-)

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
From: Dan Carpenter dan.carpen...@oracle.com
Subject: [PATCH] i2c: rk3x: add NULL entry to the end of_device_id array
TO: Wolfram Sang w...@the-dreams.de
CC: Max Schwarz max.schw...@online.de
CC: linux-...@vger.kernel.org 
CC: linux-ker...@vger.kernel.org 
CC: devicet...@vger.kernel.org 

drivers/i2c/busses/i2c-rk3x.c:610:69-70: rk3x_i2c_match is not NULL terminated at line 610

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

CC: Max Schwarz max.schw...@online.de
CC: Wolfram Sang w...@the-dreams.de
Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
---

 i2c-rk3x.c |1 +
 1 file changed, 1 insertion(+)

--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -608,6 +608,7 @@ static const struct of_device_id rk3x_i2
 	{ .compatible = rockchip,rk3066-i2c, .data = (void *)soc_data[0] },
 	{ .compatible = rockchip,rk3188-i2c, .data = (void *)soc_data[1] },
 	{ .compatible = rockchip,rk3288-i2c, .data = (void *)soc_data[2] },
+	{},
 };
 
 static int rk3x_i2c_probe(struct platform_device *pdev)
___
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] [iio:testing 25/25] drivers/iio/magnetometer/ak09911.c:301 ak09911_probe() error: we previously assumed 'id' could be null (see line 288)

2014-06-16 Thread Dan Carpenter
ak09911_probe() is called from i2c_device_probe() when we do:

status = driver-probe(client, i2c_match_id(driver-id_table, client));

The functions which implement driver-probe() are not very consistent
in how the check for a NULL return from i2c_match_id().

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head:   3b60f3cdd600858142daaf8071501cbe72a9e2b9
commit: 3b60f3cdd600858142daaf8071501cbe72a9e2b9 [25/25] iio: AK09911 : 3 axis 
compass support

drivers/iio/magnetometer/ak09911.c:301 ak09911_probe() error: we previously 
assumed 'id' could be null (see line 288)

git remote add iio git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git remote update iio
git checkout 3b60f3cdd600858142daaf8071501cbe72a9e2b9
vim +/id +301 drivers/iio/magnetometer/ak09911.c

3b60f3cd Srinivas Pandruvada 2014-11-06  282mutex_init(data-lock);
3b60f3cd Srinivas Pandruvada 2014-11-06  283  
3b60f3cd Srinivas Pandruvada 2014-11-06  284ret = ak09911_get_asa(client);
3b60f3cd Srinivas Pandruvada 2014-11-06  285if (ret)
3b60f3cd Srinivas Pandruvada 2014-11-06  286return ret;
3b60f3cd Srinivas Pandruvada 2014-11-06  287  
3b60f3cd Srinivas Pandruvada 2014-11-06 @288if (id)
3b60f3cd Srinivas Pandruvada 2014-11-06  289name = id-name;
3b60f3cd Srinivas Pandruvada 2014-11-06  290else if 
(ACPI_HANDLE(client-dev))
3b60f3cd Srinivas Pandruvada 2014-11-06  291name = 
dev_name(client-dev);
3b60f3cd Srinivas Pandruvada 2014-11-06  292else
3b60f3cd Srinivas Pandruvada 2014-11-06  293return -ENODEV;
3b60f3cd Srinivas Pandruvada 2014-11-06  294  
3b60f3cd Srinivas Pandruvada 2014-11-06  295dev_dbg(client-dev, Asahi 
compass chip %s\n, name);
3b60f3cd Srinivas Pandruvada 2014-11-06  296  
3b60f3cd Srinivas Pandruvada 2014-11-06  297indio_dev-dev.parent = 
client-dev;
3b60f3cd Srinivas Pandruvada 2014-11-06  298indio_dev-channels = 
ak09911_channels;
3b60f3cd Srinivas Pandruvada 2014-11-06  299indio_dev-num_channels = 
ARRAY_SIZE(ak09911_channels);
3b60f3cd Srinivas Pandruvada 2014-11-06  300indio_dev-info = ak09911_info;
3b60f3cd Srinivas Pandruvada 2014-11-06 @301indio_dev-name = id-name;

This is obviously a cut and paste bug and the -name = name two lines
below is intended.

3b60f3cd Srinivas Pandruvada 2014-11-06  302indio_dev-modes = 
INDIO_DIRECT_MODE;
3b60f3cd Srinivas Pandruvada 2014-11-06  303indio_dev-name = name;
3b60f3cd Srinivas Pandruvada 2014-11-06  304  

---
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] I am offline until Jul 7

2014-06-20 Thread Dan Carpenter
I'm on vacation for the next two weeks.  :)  Can someone cover for me?
Otherwise, I'll catch up when I get back.

regards,
dan carpenter

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


Re: [kbuild] [PATCH] Potential NULL pointer deference in drbg_ctr_df

2014-07-04 Thread Dan Carpenter
On Wed, Jun 25, 2014 at 05:06:46PM +0800, Herbert Xu wrote:
 On Sat, Jun 21, 2014 at 02:26:29PM +0200, Stephan Mueller wrote:
  The handling of additional input data / personalization string data may
  be subject to a NULL pointer deference for the CTR DRBG. The
  caller-provided data may be NULL which must be caught by the DRBG.
  
  Reported-by: kbuild test robot fengguang...@intel.com


Oh, huh.  This bug was actually reported by me but I forgot to change
the from header and apparently my smtp server allows me to send emails
as if I work for Intel.  :P

Fengguang is much nicer than I am.  :P

  Signed-off-by: Stephan Mueller smuel...@chronox.de
  ---
   crypto/drbg.c | 23 +--
   1 file changed, 13 insertions(+), 10 deletions(-)
  
  diff --git a/crypto/drbg.c b/crypto/drbg.c
  index faaa2ce..8e7c302 100644
  --- a/crypto/drbg.c
  +++ b/crypto/drbg.c
  @@ -513,17 +513,20 @@ static int drbg_ctr_df(struct drbg_state *drbg,
  drbg_string_fill(S2, L_N, sizeof(L_N));
  drbg_string_fill(S4, pad, padlen);
  S1.next = S2;
  -   S2.next = addtl;
   
  -   /*
  -* splice in addtl between S2 and S4 -- we place S4 at the end of the
  -* input data chain
  -*/
  -   tempstr = addtl;
  -   for (; NULL != tempstr; tempstr = tempstr-next)
  -   if (NULL == tempstr-next)
  -   break;
  -   tempstr-next = S4;
  +   if (NULL == addtl) {
  +   S2.next = S4;
  +   } else {
  +   /*
  +* splice in addtl between S2 and S4 -- we place S4 at the end
  +* of the input data chain
  +*/
  +   S2.next = addtl;
  +   tempstr = addtl;
  +   while (tempstr-next)
  +   tempstr = tempstr-next;
  +   tempstr-next = S4;
 
 You've still got exactly the same NULL dereference.

I was offline for a bit so I'm coming into this late.  It's weird that
Stephan isn't defending his patch but it looks ok to me...

regards,
dan carpenter

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


[kbuild] [thomash:vmwgfx-next 1/1] drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:482 vmw_cmd_res_reloc_add() warn: variable dereferenced before check 'p_val' (see line 448)

2014-07-07 Thread Dan Carpenter
tree:   git://people.freedesktop.org/~thomash/linux vmwgfx-next
head:   18e4a4669c5023eb1157f2a3f1bf6ca2b8535572
commit: 18e4a4669c5023eb1157f2a3f1bf6ca2b8535572 [1/1] drm/vmwgfx: Fix compat 
shader namespace

drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:482 vmw_cmd_res_reloc_add() warn: 
variable dereferenced before check 'p_val' (see line 448)

git remote add thomash git://people.freedesktop.org/~thomash/linux
git remote update thomash
git checkout 18e4a4669c5023eb1157f2a3f1bf6ca2b8535572
vim +/p_val +482 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c

18e4a466 Thomas Hellstrom 2014-06-09  442struct 
vmw_resource *res,
18e4a466 Thomas Hellstrom 2014-06-09  443struct 
vmw_resource_val_node **p_val)
18e4a466 Thomas Hellstrom 2014-06-09  444  {
18e4a466 Thomas Hellstrom 2014-06-09  445   int ret;
18e4a466 Thomas Hellstrom 2014-06-09  446   struct vmw_resource_val_node 
*node;
18e4a466 Thomas Hellstrom 2014-06-09  447  
18e4a466 Thomas Hellstrom 2014-06-09 @448   *p_val = NULL;
18e4a466 Thomas Hellstrom 2014-06-09  449   ret = 
vmw_resource_relocation_add(sw_context-res_relocations,
18e4a466 Thomas Hellstrom 2014-06-09  450   
  res,
18e4a466 Thomas Hellstrom 2014-06-09  451   
  id_loc - sw_context-buf_start);
18e4a466 Thomas Hellstrom 2014-06-09  452   if (unlikely(ret != 0))
18e4a466 Thomas Hellstrom 2014-06-09  453   goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  454  
18e4a466 Thomas Hellstrom 2014-06-09  455   ret = 
vmw_resource_val_add(sw_context, res, node);
18e4a466 Thomas Hellstrom 2014-06-09  456   if (unlikely(ret != 0))
18e4a466 Thomas Hellstrom 2014-06-09  457   goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  458  
18e4a466 Thomas Hellstrom 2014-06-09  459   if (res_type == vmw_res_context 
 dev_priv-has_mob 
18e4a466 Thomas Hellstrom 2014-06-09  460   node-first_usage) {
18e4a466 Thomas Hellstrom 2014-06-09  461  
18e4a466 Thomas Hellstrom 2014-06-09  462   /*
18e4a466 Thomas Hellstrom 2014-06-09  463* Put contexts first 
on the list to be able to exit
18e4a466 Thomas Hellstrom 2014-06-09  464* list traversal for 
contexts early.
18e4a466 Thomas Hellstrom 2014-06-09  465*/
18e4a466 Thomas Hellstrom 2014-06-09  466   list_del(node-head);
18e4a466 Thomas Hellstrom 2014-06-09  467   list_add(node-head, 
sw_context-resource_list);
18e4a466 Thomas Hellstrom 2014-06-09  468  
18e4a466 Thomas Hellstrom 2014-06-09  469   ret = 
vmw_resource_context_res_add(dev_priv, sw_context, res);
18e4a466 Thomas Hellstrom 2014-06-09  470   if (unlikely(ret != 0))
18e4a466 Thomas Hellstrom 2014-06-09  471   goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  472   node-staged_bindings =
18e4a466 Thomas Hellstrom 2014-06-09  473   
kzalloc(sizeof(*node-staged_bindings), GFP_KERNEL);
18e4a466 Thomas Hellstrom 2014-06-09  474   if 
(node-staged_bindings == NULL) {
18e4a466 Thomas Hellstrom 2014-06-09  475   
DRM_ERROR(Failed to allocate context binding 
18e4a466 Thomas Hellstrom 2014-06-09  476 
information.\n);
18e4a466 Thomas Hellstrom 2014-06-09  477   goto out_err;
18e4a466 Thomas Hellstrom 2014-06-09  478   }
18e4a466 Thomas Hellstrom 2014-06-09  479   
INIT_LIST_HEAD(node-staged_bindings-list);
18e4a466 Thomas Hellstrom 2014-06-09  480   }
18e4a466 Thomas Hellstrom 2014-06-09  481  
18e4a466 Thomas Hellstrom 2014-06-09 @482   if (p_val)
18e4a466 Thomas Hellstrom 2014-06-09  483   *p_val = node;
18e4a466 Thomas Hellstrom 2014-06-09  484  
18e4a466 Thomas Hellstrom 2014-06-09  485  out_err:

---
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] [driver-core:driver-core-next 4/5] drivers/base/component.c:297 component_master_add_with_match() error: we previously assumed 'match' could be null (see line 293)

2014-07-07 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
driver-core-next
head:   868b60e0550247fc83630070ff64bbfb803b2347
commit: 6955b58254c2bcee8a7b55ce06468a645dc98ec5 [4/5] component: add support 
for component match array

drivers/base/component.c:297 component_master_add_with_match() error: we 
previously assumed 'match' could be null (see line 293)

git remote add driver-core 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
git remote update driver-core
git checkout 6955b58254c2bcee8a7b55ce06468a645dc98ec5
vim +/match +297 drivers/base/component.c

6955b582 Russell King 2014-04-19  287   const struct component_master_ops *ops,
6955b582 Russell King 2014-04-19  288   struct component_match *match)
2a41e607 Russell King 2014-01-10  289  {
2a41e607 Russell King 2014-01-10  290   struct master *master;
2a41e607 Russell King 2014-01-10  291   int ret;
2a41e607 Russell King 2014-01-10  292  
6955b582 Russell King 2014-04-19 @293   if (ops-add_components  match)
6955b582 Russell King 2014-04-19  294   return -EINVAL;
6955b582 Russell King 2014-04-19  295  
6955b582 Russell King 2014-04-19  296   /* Reallocate the match array for its 
true size */
6955b582 Russell King 2014-04-19 @297   match = component_match_realloc(dev, 
match, match-num);
6955b582 Russell King 2014-04-19  298   if (IS_ERR(match))
6955b582 Russell King 2014-04-19  299   return PTR_ERR(match);
6955b582 Russell King 2014-04-19  300  

---
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] [renesas:rcar-audmapp-for-v3.17 3/3] drivers/dma/sh/rcar-audmapp.c:357:41-42: audmapp_of_match is not NULL terminated at line 357

2014-07-09 Thread Dan Carpenter
TO: Kuninori Morimoto kuninori.morimoto...@renesas.com
CC: Simon Horman horms+rene...@verge.net.au

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git 
rcar-audmapp-for-v3.17
head:   f86dc95232fa6999ab6246ef2e70f3805be7d4c3
commit: f86dc95232fa6999ab6246ef2e70f3805be7d4c3 [3/3] dma: rcar-audmapp: add 
DT support

 drivers/dma/sh/rcar-audmapp.c:357:41-42: audmapp_of_match is not NULL 
 terminated at line 357

Please consider folding the attached diff :-)

---
0-DAY kernel build testing backend  Open Source Technology Center
http://lists.01.org/mailman/listinfo/kbuild Intel Corporation
From: Dan Carpenter dan.carpen...@oracle.com
Subject: [PATCH] dma: rcar-audmapp: fix coccinelle warnings
TO: Simon Horman horms+rene...@verge.net.au
CC: Kuninori Morimoto kuninori.morimoto...@renesas.com
CC: dmaeng...@vger.kernel.org 
CC: linux-ker...@vger.kernel.org 
CC: devicet...@vger.kernel.org 

drivers/dma/sh/rcar-audmapp.c:357:41-42: audmapp_of_match is not NULL terminated at line 357

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

CC: Kuninori Morimoto kuninori.morimoto...@renesas.com
CC: Simon Horman horms+rene...@verge.net.au
Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
---

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

 rcar-audmapp.c |1 +
 1 file changed, 1 insertion(+)

--- a/drivers/dma/sh/rcar-audmapp.c
+++ b/drivers/dma/sh/rcar-audmapp.c
@@ -355,6 +355,7 @@ static int audmapp_remove(struct platfor
 
 static const struct of_device_id audmapp_of_match[] = {
 	{ .compatible = renesas,rcar-audmapp, },
+	{},
 };
 
 static struct platform_driver audmapp_driver = {
___
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] [drm-intel:for-linux-next 143/143] drivers/gpu/drm/i915/i915_irq.c:1385 vlv_calc_delay_from_C0_counters() warn: impossible condition '(adj 0) = (0-255 0)'

2014-07-09 Thread Dan Carpenter
tree:   git://anongit.freedesktop.org/drm-intel for-linux-next
head:   31685c258e0b0ad6aa486c5ec001382cf8a64212
commit: 31685c258e0b0ad6aa486c5ec001382cf8a64212 [143/143] drm/i915/vlv: WA for 
Turbo and RC6 to work together.

drivers/gpu/drm/i915/i915_irq.c:1385 vlv_calc_delay_from_C0_counters() warn: 
impossible condition '(adj  0) = (0-255  0)'

git remote add drm-intel git://anongit.freedesktop.org/drm-intel
git remote update drm-intel
git checkout 31685c258e0b0ad6aa486c5ec001382cf8a64212
vim +1385 drivers/gpu/drm/i915/i915_irq.c

31685c25 Deepak S 2014-07-03  1369  adj *= 2;
31685c25 Deepak S 2014-07-03  1370  else
31685c25 Deepak S 2014-07-03  1371  adj = 1;
31685c25 Deepak S 2014-07-03  1372  
31685c25 Deepak S 2014-07-03  1373  if (dev_priv-rps.cur_freq  
dev_priv-rps.max_freq_softlimit)
31685c25 Deepak S 2014-07-03  1374  new_delay = 
dev_priv-rps.cur_freq + adj;
31685c25 Deepak S 2014-07-03  1375  
31685c25 Deepak S 2014-07-03  1376  /*
31685c25 Deepak S 2014-07-03  1377   * For better performance, jump 
directly
31685c25 Deepak S 2014-07-03  1378   * to RPe if we're below it.
31685c25 Deepak S 2014-07-03  1379   */
31685c25 Deepak S 2014-07-03  1380  if (new_delay  
dev_priv-rps.efficient_freq)
31685c25 Deepak S 2014-07-03  1381  new_delay = 
dev_priv-rps.efficient_freq;
31685c25 Deepak S 2014-07-03  1382  
31685c25 Deepak S 2014-07-03  1383  } else if 
(!dev_priv-rps.ei_interrupt_count 
31685c25 Deepak S 2014-07-03  1384  (residency_C0_down  
VLV_RP_DOWN_EI_THRESHOLD)) {
31685c25 Deepak S 2014-07-03 @1385  if (adj  0)
31685c25 Deepak S 2014-07-03  1386  adj *= 2;
31685c25 Deepak S 2014-07-03  1387  else
31685c25 Deepak S 2014-07-03  1388  adj = -1;
31685c25 Deepak S 2014-07-03  1389  /*
31685c25 Deepak S 2014-07-03  1390   * This means, C0 residency is 
less than down threshold over
31685c25 Deepak S 2014-07-03  1391   * a period of 
VLV_INT_COUNT_FOR_DOWN_EI. So, reduce the freq
31685c25 Deepak S 2014-07-03  1392   */
31685c25 Deepak S 2014-07-03  1393  if (dev_priv-rps.cur_freq  
dev_priv-rps.min_freq_softlimit)

---
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:drm-intel-next-queued 126/130] drivers/gpu/drm/i915/i915_gpu_error.c:784 gen8_record_semaphore_state() error: buffer overflow 'ering-semaphore_mboxes' 4 = 4

2014-07-09 Thread Dan Carpenter
tree:   git://anongit.freedesktop.org/drm-intel drm-intel-next-queued
head:   f7d2323c181ed5a2596494b860a99d567fd3e6cd
commit: 0ca36d78391dc97b7d3e3d26e4518e30f3e88c16 [126/130] drm/i915/bdw: 
collect semaphore error state

drivers/gpu/drm/i915/i915_gpu_error.c:784 gen8_record_semaphore_state() error: 
buffer overflow 'ering-semaphore_mboxes' 4 = 4
drivers/gpu/drm/i915/i915_gpu_error.c:785 gen8_record_semaphore_state() error: 
buffer overflow 'ring-semaphore.sync_seqno' 4 = 4
drivers/gpu/drm/i915/i915_gpu_error.c:785 gen8_record_semaphore_state() error: 
buffer overflow 'ering-semaphore_seqno' 4 = 4

git remote add drm-intel git://anongit.freedesktop.org/drm-intel
git remote update drm-intel
git checkout 0ca36d78391dc97b7d3e3d26e4518e30f3e88c16
vim +784 drivers/gpu/drm/i915/i915_gpu_error.c

0ca36d78 Ben Widawsky 2014-06-30  778  
0ca36d78 Ben Widawsky 2014-06-30  779   for_each_ring(useless, dev_priv, i) {
^

This loop goes to i  I915_NUM_RINGS but -semaphore_mboxes[] has
I915_NUM_RINGS - 1 elements.

0ca36d78 Ben Widawsky 2014-06-30  780   u16 signal_offset =
0ca36d78 Ben Widawsky 2014-06-30  781   
(GEN8_SIGNAL_OFFSET(ring, i)  PAGE_MASK) / 4;
0ca36d78 Ben Widawsky 2014-06-30  782   u32 *tmp = 
error-semaphore_obj-pages[0];
0ca36d78 Ben Widawsky 2014-06-30  783  
0ca36d78 Ben Widawsky 2014-06-30 @784   ering-semaphore_mboxes[i] = 
tmp[signal_offset];
0ca36d78 Ben Widawsky 2014-06-30 @785   ering-semaphore_seqno[i] = 
ring-semaphore.sync_seqno[i];
0ca36d78 Ben Widawsky 2014-06-30  786   }
0ca36d78 Ben Widawsky 2014-06-30  787  }
0ca36d78 Ben Widawsky 2014-06-30  788  

---
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 234/273] net/ipv6/ip6_output.c:209 ip6_xmit() error: we previously assumed 'np' could be null (see line 203)

2014-07-09 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   52d14c6661bc08ed51c271a5a9ff3210abef98b4
commit: cb1ce2ef387b01686469487edd45994872d52d73 [234/273] ipv6: Implement 
automatic flow label generation on transmit

New smatch warnings:
net/ipv6/ip6_output.c:209 ip6_xmit() error: we previously assumed 'np' could be 
null (see line 203)

Old smatch warnings:
net/ipv6/ip6_output.c:912 ip6_dst_lookup_tail() warn: variable dereferenced 
before check 'sk' (see line 896)

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 cb1ce2ef387b01686469487edd45994872d52d73
vim +/np +209 net/ipv6/ip6_output.c

e2d1bca7 Arnaldo Carvalho de Melo 2007-04-10  197   
skb_reset_network_header(skb);
0660e03f Arnaldo Carvalho de Melo 2007-04-25  198   hdr = ipv6_hdr(skb);
^1da177e Linus Torvalds   2005-04-16  199  
^1da177e Linus Torvalds   2005-04-16  200   /*
^1da177e Linus Torvalds   2005-04-16  201*  Fill in the 
IPv6 header
^1da177e Linus Torvalds   2005-04-16  202*/
b903d324 Eric Dumazet 2011-10-27 @203   if (np)
^1da177e Linus Torvalds   2005-04-16  204   hlimit = 
np-hop_limit;
^1da177e Linus Torvalds   2005-04-16  205   if (hlimit  0)
6b75d090 YOSHIFUJI Hideaki2008-03-10  206   hlimit = 
ip6_dst_hoplimit(dst);
^1da177e Linus Torvalds   2005-04-16  207  
cb1ce2ef Tom Herbert  2014-07-01  208   ip6_flow_hdr(hdr, 
tclass, ip6_make_flowlabel(net, skb, fl6-flowlabel,
cb1ce2ef Tom Herbert  2014-07-01 @209   
 np-autoflowlabel));
41a1f8ea YOSHIFUJI Hideaki2005-09-08  210  
^1da177e Linus Torvalds   2005-04-16  211   hdr-payload_len = 
htons(seg_len);
^1da177e Linus Torvalds   2005-04-16  212   hdr-nexthdr = proto;

---
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] [drdb:for-3.17 44/61] drivers/block/drbd/drbd_req.c:1611 request_timer_fn() warn: inconsistent returns spin_lock:connection-resource-req_lock: locked (1544) unlocked (1611)

2014-07-10 Thread Dan Carpenter
[ It's complaining because of 0500813fe0c9a ('drbd: Move conf_mutex from
  connection to resource') because connection-resource-req_lock and
  device-resource-req_lock aren't used consistently.  It's old code
  but still confusing so I'll pass the warning along.  -dan ]

tree:   git://git.drbd.org/linux-drbd.git for-3.17
head:   3f500c97166a2cdd7c15743c77c5ba3c766904de
commit: 0b95c7a2e8a23c00dc17a690f4c57feef0aca549 [44/61] drbd: add caching 
oldest request pointers for replication stages

drivers/block/drbd/drbd_req.c:1611 request_timer_fn() warn: inconsistent 
returns spin_lock:connection-resource-req_lock: locked (1544) unlocked (1611)
drivers/block/drbd/drbd_req.c:1611 request_timer_fn() warn: inconsistent 
returns spin_lock:device-resource-req_lock: locked (1611) unlocked (1544)

git remote add drdb git://git.drbd.org/linux-drbd.git
git remote update drdb
git checkout 0b95c7a2e8a23c00dc17a690f4c57feef0aca549
vim +1611 drivers/block/drbd/drbd_req.c

dfa8bedb Philipp Reisner 2011-06-29  1538   }
44ed167d Philipp Reisner 2011-04-19  1539   rcu_read_unlock();
7fde2be9 Philipp Reisner 2011-03-01  1540  
dfa8bedb Philipp Reisner 2011-06-29  1541   et = min_not_zero(dt, ent);
dfa8bedb Philipp Reisner 2011-06-29  1542  
ba280c09 Lars Ellenberg  2012-04-25  1543   if (!et)
7fde2be9 Philipp Reisner 2011-03-01 @1544   return; /* Recurring 
timer stopped */
7fde2be9 Philipp Reisner 2011-03-01  1545  
ba280c09 Lars Ellenberg  2012-04-25  1546   now = jiffies;
0b95c7a2 Lars Ellenberg  2013-11-22  1547   nt = now + et;
ba280c09 Lars Ellenberg  2012-04-25  1548  
0500813f Andreas Gruenbacher 2011-07-07  1549   
spin_lock_irq(device-resource-req_lock);
0b95c7a2 Lars Ellenberg  2013-11-22  1550   req_read = 
list_first_entry_or_null(device-pending_completion[0], struct drbd_request, 
req_pending_local);
0b95c7a2 Lars Ellenberg  2013-11-22  1551   req_write = 
list_first_entry_or_null(device-pending_completion[1], struct drbd_request, 
req_pending_local);
0b95c7a2 Lars Ellenberg  2013-11-22  1552   req_peer = 
connection-req_not_net_done;
0b95c7a2 Lars Ellenberg  2013-11-22  1553   /* maybe the oldest request 
waiting for the peer is in fact still
0b95c7a2 Lars Ellenberg  2013-11-22  1554* blocking in tcp sendmsg */
0b95c7a2 Lars Ellenberg  2013-11-22  1555   if (!req_peer  
connection-req_next  connection-req_next-pre_send_jif)
0b95c7a2 Lars Ellenberg  2013-11-22  1556   req_peer = 
connection-req_next;
0b95c7a2 Lars Ellenberg  2013-11-22  1557  
0b95c7a2 Lars Ellenberg  2013-11-22  1558   /* evaluate the oldest peer 
request only in one timer! */
0b95c7a2 Lars Ellenberg  2013-11-22  1559   if (req_peer  
req_peer-device != device)
0b95c7a2 Lars Ellenberg  2013-11-22  1560   req_peer = NULL;
0b95c7a2 Lars Ellenberg  2013-11-22  1561  
0b95c7a2 Lars Ellenberg  2013-11-22  1562   /* do we have something to 
evaluate? */
0b95c7a2 Lars Ellenberg  2013-11-22  1563   if (req_peer == NULL  
req_write == NULL  req_read == NULL)
0b95c7a2 Lars Ellenberg  2013-11-22  1564   goto out;
0b95c7a2 Lars Ellenberg  2013-11-22  1565  
0b95c7a2 Lars Ellenberg  2013-11-22  1566   oldest_submit_jif =
0b95c7a2 Lars Ellenberg  2013-11-22  1567   (req_write  req_read)
0b95c7a2 Lars Ellenberg  2013-11-22  1568   ? ( 
time_before(req_write-pre_submit_jif, req_read-pre_submit_jif)
0b95c7a2 Lars Ellenberg  2013-11-22  1569 ? 
req_write-pre_submit_jif : req_read-pre_submit_jif )
0b95c7a2 Lars Ellenberg  2013-11-22  1570   : req_write ? 
req_write-pre_submit_jif
0b95c7a2 Lars Ellenberg  2013-11-22  1571   : req_read ? 
req_read-pre_submit_jif : now;
7fde2be9 Philipp Reisner 2011-03-01  1572  
ba280c09 Lars Ellenberg  2012-04-25  1573   /* The request is considered 
timed out, if
ba280c09 Lars Ellenberg  2012-04-25  1574* - we have some effective 
timeout from the configuration,
ba280c09 Lars Ellenberg  2012-04-25  1575*   with above state 
restrictions applied,
ba280c09 Lars Ellenberg  2012-04-25  1576* - the oldest request is 
waiting for a response from the network
ba280c09 Lars Ellenberg  2012-04-25  1577*   resp. the local disk,
ba280c09 Lars Ellenberg  2012-04-25  1578* - the oldest request is in 
fact older than the effective timeout,
ba280c09 Lars Ellenberg  2012-04-25  1579* - the connection was 
established (resp. disk was attached)
ba280c09 Lars Ellenberg  2012-04-25  1580*   for longer than the 
timeout already.
ba280c09 Lars Ellenberg  2012-04-25  1581* Note that for 32bit jiffies 
and very stable connections/disks,
ba280c09 Lars Ellenberg  2012-04-25  1582* we may have a wrap around, 
which is catched by
ba280c09 Lars Ellenberg  2012-04-25  1583*   !time_in_range(now, 
last_..._jif, last_..._jif + timeout).
ba280c09 Lars Ellenberg  

[kbuild] [xhci:test_ep_reset_halt 1/2] drivers/usb/host/xhci.c:3111:11-20: ERROR: ctrl_ctx is NULL but dereferenced.

2014-07-11 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git 
test_ep_reset_halt
head:   fb58633ed195254fba6794db78946ac54232eefd
commit: 73651f7b5ce760f0085ad5e262e62633a2d039b5 [1/2] xhci: Fix endpoint halt 
and reset handling. WORK IN PROGRESS

 drivers/usb/host/xhci.c:3111:11-20: ERROR: ctrl_ctx is NULL but dereferenced.

git remote add xhci 
git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git
git remote update xhci
git checkout 73651f7b5ce760f0085ad5e262e62633a2d039b5
vim +3111 drivers/usb/host/xhci.c

73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3095   * it will 
do the same?
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3096   * No, add 
check in xhci_configure_endpoint instead if that ep happends
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3097   * to be 
in the middle of CONFIG_EP_PENDING, fail that configure endpoint
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3098   * (or 
move it forward??) */
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3099  
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3100 
xhci_err(xhci, MATTU submit config endpiont cmd\n);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3101 
xhci_queue_configure_endpoint(xhci, command_conf, virt_dev-in_ctx-dma,
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3102 
  udev-slot_id, false);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3103 
xhci_ring_cmd_db(xhci);
a1587d97 drivers/usb/host/xhci-hcd.c Sarah Sharp   2009-07-27  3104 
spin_unlock_irqrestore(xhci-lock, flags);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3105 
xhci_err(xhci, MATTU wait for config ep\n);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3106 
wait_for_completion(command_conf-completion);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3107 
xhci_err(xhci, MATTU config ep done\n);
a1587d97 drivers/usb/host/xhci-hcd.c Sarah Sharp   2009-07-27  3108  
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3109  cleanup:
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3110 /* LOCK 
for  ep_state? and control context? */
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15 @3111 
ctrl_ctx-add_flags = 0;
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3112 
ctrl_ctx-drop_flags = 0;
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3113 
virt_ep-ep_state = ~EP_CONFIG_PENDING;
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3114 
kfree(command-completion);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3115 
kfree(command);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3116 
kfree(command_conf-completion);
73651f7b drivers/usb/host/xhci.c Mathias Nyman 2014-04-15  3117 
kfree(command_conf);
a1587d97 drivers/usb/host/xhci-hcd.c Sarah Sharp   2009-07-27  3118  }
a1587d97 drivers/usb/host/xhci-hcd.c Sarah Sharp   2009-07-27  3119  

---
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] [asoc:topic/rockchip 2/3] sound/soc/rockchip/rockchip_i2s.c:145:8-19: duplicated argument to or |

2014-07-11 Thread Dan Carpenter
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 
topic/rockchip
head:   1b21572f8fd791f5b54e5989bc8e0cc5308d2e6c
commit: 4495c89fcf2624d542a27f1ecd70aa3524c54195 [2/3] ASoC: add driver for 
Rockchip RK3xxx I2S controller

 sound/soc/rockchip/rockchip_i2s.c:145:8-19: duplicated argument to  or |
 sound/soc/rockchip/rockchip_i2s.c:146:8-19: duplicated argument to  or |
 sound/soc/rockchip/rockchip_i2s.c:101:8-19: duplicated argument to  or |
 sound/soc/rockchip/rockchip_i2s.c:102:8-19: duplicated argument to  or |

git remote add asoc 
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
git remote update asoc
git checkout 4495c89fcf2624d542a27f1ecd70aa3524c54195
vim +145 sound/soc/rockchip/rockchip_i2s.c

4495c89f Jianqun Xu 2014-07-05   95
I2S_XFER_TXS_START |
4495c89f Jianqun Xu 2014-07-05   96
I2S_XFER_RXS_START,
4495c89f Jianqun Xu 2014-07-05   97
I2S_XFER_TXS_STOP |
4495c89f Jianqun Xu 2014-07-05   98
I2S_XFER_RXS_STOP);
4495c89f Jianqun Xu 2014-07-05   99  
4495c89f Jianqun Xu 2014-07-05  100 
regmap_update_bits(i2s-regmap, I2S_CLR,
4495c89f Jianqun Xu 2014-07-05 @101
I2S_CLR_TXC | I2S_CLR_TXC,
4495c89f Jianqun Xu 2014-07-05 @102
I2S_CLR_TXC | I2S_CLR_TXC);
4495c89f Jianqun Xu 2014-07-05  103  
4495c89f Jianqun Xu 2014-07-05  104 
regmap_read(i2s-regmap, I2S_CLR, val);
4495c89f Jianqun Xu 2014-07-05  105  
4495c89f Jianqun Xu 2014-07-05  106 /* Should wait for 
clear operation to finish */
4495c89f Jianqun Xu 2014-07-05  107 while (val) {
4495c89f Jianqun Xu 2014-07-05  108 
regmap_read(i2s-regmap, I2S_CLR, val);
4495c89f Jianqun Xu 2014-07-05  109 retry--;
4495c89f Jianqun Xu 2014-07-05  110 if (!retry)
4495c89f Jianqun Xu 2014-07-05  111 
dev_warn(i2s-dev, fail to clear\n);
4495c89f Jianqun Xu 2014-07-05  112 }
4495c89f Jianqun Xu 2014-07-05  113 }
4495c89f Jianqun Xu 2014-07-05  114 }
4495c89f Jianqun Xu 2014-07-05  115  }
4495c89f Jianqun Xu 2014-07-05  116  
4495c89f Jianqun Xu 2014-07-05  117  static void rockchip_snd_rxctrl(struct 
rk_i2s_dev *i2s, int on)
4495c89f Jianqun Xu 2014-07-05  118  {
4495c89f Jianqun Xu 2014-07-05  119 unsigned int val = 0;
4495c89f Jianqun Xu 2014-07-05  120 int retry = 10;
4495c89f Jianqun Xu 2014-07-05  121  
4495c89f Jianqun Xu 2014-07-05  122 if (on) {
4495c89f Jianqun Xu 2014-07-05  123 regmap_update_bits(i2s-regmap, 
I2S_DMACR,
4495c89f Jianqun Xu 2014-07-05  124
I2S_DMACR_RDE_ENABLE, I2S_DMACR_RDE_ENABLE);
4495c89f Jianqun Xu 2014-07-05  125  
4495c89f Jianqun Xu 2014-07-05  126 regmap_update_bits(i2s-regmap, 
I2S_XFER,
4495c89f Jianqun Xu 2014-07-05  127
I2S_XFER_TXS_START | I2S_XFER_RXS_START,
4495c89f Jianqun Xu 2014-07-05  128
I2S_XFER_TXS_START | I2S_XFER_RXS_START);
4495c89f Jianqun Xu 2014-07-05  129  
4495c89f Jianqun Xu 2014-07-05  130 i2s-rx_start = true;
4495c89f Jianqun Xu 2014-07-05  131 } else {
4495c89f Jianqun Xu 2014-07-05  132 i2s-rx_start = false;
4495c89f Jianqun Xu 2014-07-05  133  
4495c89f Jianqun Xu 2014-07-05  134 regmap_update_bits(i2s-regmap, 
I2S_DMACR,
4495c89f Jianqun Xu 2014-07-05  135
I2S_DMACR_RDE_ENABLE, I2S_DMACR_RDE_DISABLE);
4495c89f Jianqun Xu 2014-07-05  136  
4495c89f Jianqun Xu 2014-07-05  137 if (!i2s-tx_start) {
4495c89f Jianqun Xu 2014-07-05  138 
regmap_update_bits(i2s-regmap, I2S_XFER,
4495c89f Jianqun Xu 2014-07-05  139
I2S_XFER_TXS_START |
4495c89f Jianqun Xu 2014-07-05  140
I2S_XFER_RXS_START,
4495c89f Jianqun Xu 2014-07-05  141
I2S_XFER_TXS_STOP |
4495c89f Jianqun Xu 2014-07-05  142
I2S_XFER_RXS_STOP);
4495c89f Jianqun Xu 2014-07-05  143  
4495c89f Jianqun Xu 2014-07-05  144 
regmap_update_bits(i2s-regmap, I2S_CLR,
4495c89f Jianqun Xu 2014-07-05 @145
I2S_CLR_TXC | I2S_CLR_TXC,
4495c89f Jianqun Xu 2014-07-05 @146
I2S_CLR_TXC | I2S_CLR_TXC);
4495c89f Jianqun Xu 2014-07-05  147  
4495c89f Jianqun Xu 2014-07-05  148 
regmap_read(i2s-regmap, I2S_CLR, val);
4495c89f Jianqun Xu 2014-07-05  149  

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

Re: [kbuild] [ext4:dev 8/8] fs/ext4/indirect.c:1462 ext4_ind_remove_space() error: we previously assumed 'partial-bh' could be null (see line 1441)

2014-07-14 Thread Dan Carpenter
On Mon, Jul 14, 2014 at 01:29:02PM +0200, Lukáš Czerner wrote:
 On Sat, 12 Jul 2014, Dan Carpenter wrote:
 
  Date: Sat, 12 Jul 2014 12:34:09 +0300
  From: Dan Carpenter dan.carpen...@oracle.com
  To: Lukas Czerner lczer...@redhat.com, kbu...@01.org
  Cc: Theodore Ts'o ty...@mit.edu, Dan Carpenter dan.carpen...@oracle.com
  Subject: [ext4:dev 8/8] fs/ext4/indirect.c:1462 ext4_ind_remove_space() 
  error:
   we previously assumed 'partial-bh' could be null (see line 1441)
  
  tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
  head:   ae3a8a51e8906c552f8edfc7202c1b2bb6f73409
  commit: ae3a8a51e8906c552f8edfc7202c1b2bb6f73409 [8/8] ext4: fix punch hole 
  on files with indirect mapping
  
  fs/ext4/indirect.c:1462 ext4_ind_remove_space() error: we previously 
  assumed 'partial-bh' could be null (see line 1441)
  fs/ext4/indirect.c:1474 ext4_ind_remove_space() error: we previously 
  assumed 'partial2-bh' could be null (see line 1441)
 
 Both of those are false positives, because if ( partial  chain )
 then partial-bh will always be set. But I am wondering how to
 silence the warning without introducing more pointless checks.
 
 Maybe we can remove 
   if ((partial-bh  partial2-bh) 
 
 and substitute it with
   if (((partial  chain)  (partial2  chain2)) 
 
 I'll retest and resend the patch.

Normally I just say we should leave false positives there.  Eventually
the tools will get smarter.

regards,
dan carpenter

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


  1   2   3   4   5   6   7   8   9   10   >