Skip to content

Commit 47f0783

Browse files
Colin Ian Kinggregkh
authored andcommitted
Revert "staging: fsl-mc: be consistent when checking strcmp() return"
The previous fix removed the equal to zero comparisons by the strcmps and now the function always returns true. Revert this change to restore the original correctly functioning code. Detected by CoverityScan, CID#1452267 ("Constant expression result") This reverts commit b93ad9a. Fixes: b93ad9a ("staging: fsl-mc: be consistent when checking strcmp() return") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ef95484 commit 47f0783

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/staging/fsl-mc/bus/fsl-mc-allocator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
static bool __must_check fsl_mc_is_allocatable(const char *obj_type)
1818
{
19-
return strcmp(obj_type, "dpbp") ||
20-
strcmp(obj_type, "dpmcp") ||
21-
strcmp(obj_type, "dpcon");
19+
return strcmp(obj_type, "dpbp") == 0 ||
20+
strcmp(obj_type, "dpmcp") == 0 ||
21+
strcmp(obj_type, "dpcon") == 0;
2222
}
2323

2424
/**

0 commit comments

Comments
 (0)