Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1448350
| From | James Simmons <jsimmons@infradead.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 36/58] staging: lustre: lmv: fix issue found by Klocwork Insight tool |
| Date | 2016-07-22 05:40 +0200 |
| Message-ID | <rXztD-dP-1@gated-at.bofh.it> (permalink) |
| References | <rXyQV-88M-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Dmitry Eremin <dmitry.eremin@intel.com>
'plock.cookie' might be used uninitialized in this function.
sscanf format specification '%d' expects type 'int *' for 'd',
but parameter 3 has a different type '__u32*'
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629
Reviewed-on: http://review.whamcloud.com/9390
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
drivers/staging/lustre/lustre/lmv/lmv_intent.c | 6 ++++--
drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
index 2bc1098..51b7048 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
@@ -137,8 +137,10 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm,
it->it_remote_lock_mode = it->it_lock_mode;
}
- it->it_lock_handle = plock.cookie;
- it->it_lock_mode = pmode;
+ if (pmode) {
+ it->it_lock_handle = plock.cookie;
+ it->it_lock_mode = pmode;
+ }
out_free_op_data:
kfree(op_data);
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index e51ea1f..9e3d35a 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -1421,7 +1421,7 @@ static int lmv_process_config(struct obd_device *obd, u32 len, void *buf)
obd_str2uuid(&obd_uuid, lustre_cfg_buf(lcfg, 1));
- if (sscanf(lustre_cfg_buf(lcfg, 2), "%d", &index) != 1) {
+ if (sscanf(lustre_cfg_buf(lcfg, 2), "%u", &index) != 1) {
rc = -EINVAL;
goto out;
}
--
1.7.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/58] staging: lustre: bug fixes from lustre 2.5.[56-58] James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200 [PATCH 07/58] staging: lustre: llite: label the debug info James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200 [PATCH 02/58] staging: lustre: obd: rename struct lmv_stripe_md field mea to lmv James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200 [PATCH 05/58] staging: lustre: lmv: add new lmv structures James Simmons <jsimmons@infradead.org> - 2016-07-22 05:00 +0200 [PATCH 10/58] staging: lustre: llite: reduce indent in ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200 [PATCH 06/58] staging: lustre: mdc: handle IT_READDIR operations James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200 [PATCH 08/58] staging: lustre: llite: pass struct md_op_data to ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200 [PATCH 03/58] staging: lustre: ptlrpc: remove wirecheck for struct lmv_stripe_md James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200 [PATCH 15/58] staging: lustre: llite: clarify some debug messages for statahead James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200 [PATCH 04/58] staging: lustre: llite: cache directory striping information James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200 [PATCH 14/58] staging: lustre: llite: rename some variables for ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:10 +0200 [PATCH 16/58] staging: lustre: llite: remove code never called James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200 [PATCH 23/58] staging: lustre: llite: change remove parameter to bool James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200 [PATCH 24/58] staging: lustre: mdc: don't take rpc lock for readdir case James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200 [PATCH 17/58] staging: lustre: llite: pass in __u64 pos for ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200 [PATCH 21/58] staging: lustre: llite: style cleanup for llite_internal.h James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200 [PATCH 11/58] staging: lustre: llite: set next only when needed in ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200 [PATCH 13/58] staging: lustre: llite: change done flag in ll_dir_read to bool James Simmons <jsimmons@infradead.org> - 2016-07-22 05:20 +0200 [PATCH 25/58] staging: lustre: lmv: remove unused lmv_get_mea function James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 20/58] staging: lustre: llite: remove comment from ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 19/58] staging: lustre: llite: add md_op_data parameter to ll_get_dir_page James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 26/58] staging: lustre: lmv: remove duplicate MAX_HASH_* James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 22/58] staging: lustre: llite: pass inode to ll_release_page James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 12/58] staging: lustre: llite: handle done flags differently in ll_dir_read James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 28/58] staging: lustre: lmv: remove lmv_get_easize James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 27/58] staging: lustre: lmv: change handling of lmv striping information James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 18/58] staging: lustre: llite: do post work for statahead in readdir case James Simmons <jsimmons@infradead.org> - 2016-07-22 05:30 +0200 [PATCH 36/58] staging: lustre: lmv: fix issue found by Klocwork Insight tool James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200 [PATCH 29/58] staging: lustre: lmv: replace obd_free_memmd with lmv_free_memmd James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200 [PATCH 34/58] staging: lustre: obdclass: bug fixes for lu_device_type handling James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200 [PATCH 31/58] staging: lustre: llite: fix "getdirstripe" to show stripe info James Simmons <jsimmons@infradead.org> - 2016-07-22 05:40 +0200 [PATCH 32/58] staging: lustre: delete striped directory James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200 [PATCH 33/58] staging: lustre: obdclass: fix lmd_parse() to handle comma-separated NIDs James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200 [PATCH 41/58] staging: lustre: mdc: fixup MDS_SWAP_LAYOUTS ELC handling James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200 [PATCH 38/58] staging: lustre: llite: enable clients to inject error for lfsck James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200 [PATCH 43/58] staging: lustre: const correct FID/OSTID/... helpers James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200 [PATCH 40/58] staging: lustre: llite: a few fixes for migration. James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200 [PATCH 35/58] staging: lustre: add ability to migrate inodes. James Simmons <jsimmons@infradead.org> - 2016-07-22 05:50 +0200 [PATCH 39/58] staging: lustre: osc: allow to call brw_commit() multiple times James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200 [PATCH 50/58] staging: lustre: lov: handle the case of stripe size is not power 2 James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200 [PATCH 37/58] staging: lustre: libcfs: Only dump log once per sec. to avoid EEXIST James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200 [PATCH 49/58] staging: lustre: llite: avoid a deadlock in page write James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200 [PATCH 46/58] staging: lustre: lmv: access lum_stripe_offset as little endian James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200 [PATCH 44/58] staging: lustre: use bool for several function in lustre_idl.h/lustre_fid.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200 [PATCH 42/58] staging: lustre: don't need to const __u64 parameters for lustre_idl.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:00 +0200 [PATCH 45/58] staging: lustre: simplify inline functions in lustre_fid.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200 [PATCH 55/58] staging: lustre: ldlm: flock completion fixes. James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200 [PATCH 47/58] staging: lustre: lmv: lookup remote migrating object in LMV James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200 [PATCH 52/58] staging: lustre: lmv: rename request to preq in lmv_getattr_name() James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200 [PATCH 51/58] staging: lustre: lmv: cleanup req in lmv_getattr_name() James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200 [PATCH 48/58] staging: lustre: lmv: Ensure lmv_intent_lookup cleans up reqp James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200 [PATCH 53/58] staging: lustre: obdclass: unified flow control interfaces James Simmons <jsimmons@infradead.org> - 2016-07-22 06:10 +0200 [PATCH 57/58] staging: lustre: llite: add error handler in inode prepare phase James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200 [PATCH 58/58] staging: lustre: ptlrpc: Early replies need to honor at_max James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200 [PATCH 54/58] staging: lustre: reorder LOV_MAGIC_* definition James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200 [PATCH 56/58] staging: lustre: move ioctls to lustre_ioctl.h James Simmons <jsimmons@infradead.org> - 2016-07-22 06:20 +0200
csiph-web