diff options
author | Colin Ian King <colin.king@canonical.com> | 2015-07-23 11:47:59 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-07-27 07:58:15 -0400 |
commit | 134bf30c06f057d6b8d90132e8f8b3cd2be79572 (patch) | |
tree | 18e54851abf6c3300448b933c150c802894f800b | |
parent | 0a927c2f02a2437a57679527e42ab7cbfa14efb1 (diff) |
dm cache policy smq: fix alloc_bitset check that always evaluates as false
static analysis by cppcheck has found a check on alloc_bitset that
always evaluates as false and hence never finds an allocation failure:
[drivers/md/dm-cache-policy-smq.c:1689]: (warning) Logical conjunction
always evaluates to false: !EXPR && EXPR.
Fix this by removing the incorrect mq->cache_hit_bits check
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | drivers/md/dm-cache-policy-smq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-cache-policy-smq.c b/drivers/md/dm-cache-policy-smq.c index b6f22651dd35..48a4a826ae07 100644 --- a/drivers/md/dm-cache-policy-smq.c +++ b/drivers/md/dm-cache-policy-smq.c | |||
@@ -1686,7 +1686,7 @@ static struct dm_cache_policy *smq_create(dm_cblock_t cache_size, | |||
1686 | 1686 | ||
1687 | if (from_cblock(cache_size)) { | 1687 | if (from_cblock(cache_size)) { |
1688 | mq->cache_hit_bits = alloc_bitset(from_cblock(cache_size)); | 1688 | mq->cache_hit_bits = alloc_bitset(from_cblock(cache_size)); |
1689 | if (!mq->cache_hit_bits && mq->cache_hit_bits) { | 1689 | if (!mq->cache_hit_bits) { |
1690 | DMERR("couldn't allocate cache hit bitset"); | 1690 | DMERR("couldn't allocate cache hit bitset"); |
1691 | goto bad_cache_hit_bits; | 1691 | goto bad_cache_hit_bits; |
1692 | } | 1692 | } |