All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged] mm-zswap-change-incorrect-strncmp-use-to-strcmp.patch removed from -mm tree
@ 2015-12-21 20:25 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2015-12-21 20:25 UTC (permalink / raw)
  To: ddstreet, sjennings, weijie.yang, mm-commits


The patch titled
     Subject: mm/zswap: change incorrect strncmp use to strcmp
has been removed from the -mm tree.  Its filename was
     mm-zswap-change-incorrect-strncmp-use-to-strcmp.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Dan Streetman <ddstreet@ieee.org>
Subject: mm/zswap: change incorrect strncmp use to strcmp

Change the use of strncmp in zswap_pool_find_get() to strcmp.

The use of strncmp is no longer correct, now that zswap_zpool_type is not
an array; sizeof() will return the size of a pointer, which isn't the
right length to compare.  We don't need to use strncmp anyway, because the
existing params and the passed in params are all guaranteed to be null
terminated, so strcmp should be used.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Reported-by: Weijie Yang <weijie.yang@samsung.com>
Cc: Seth Jennings <sjennings@variantweb.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/zswap.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN mm/zswap.c~mm-zswap-change-incorrect-strncmp-use-to-strcmp mm/zswap.c
--- a/mm/zswap.c~mm-zswap-change-incorrect-strncmp-use-to-strcmp
+++ a/mm/zswap.c
@@ -541,6 +541,7 @@ static struct zswap_pool *zswap_pool_las
 	return last;
 }
 
+/* type and compressor must be null-terminated */
 static struct zswap_pool *zswap_pool_find_get(char *type, char *compressor)
 {
 	struct zswap_pool *pool;
@@ -548,10 +549,9 @@ static struct zswap_pool *zswap_pool_fin
 	assert_spin_locked(&zswap_pools_lock);
 
 	list_for_each_entry_rcu(pool, &zswap_pools, list) {
-		if (strncmp(pool->tfm_name, compressor, sizeof(pool->tfm_name)))
+		if (strcmp(pool->tfm_name, compressor))
 			continue;
-		if (strncmp(zpool_get_type(pool->zpool), type,
-			    sizeof(zswap_zpool_type)))
+		if (strcmp(zpool_get_type(pool->zpool), type))
 			continue;
 		/* if we can't get it, it's about to be destroyed */
 		if (!zswap_pool_get(pool))
_

Patches currently in -mm which might be from ddstreet@ieee.org are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-21 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21 20:25 [merged] mm-zswap-change-incorrect-strncmp-use-to-strcmp.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.