From: Mathias Krause Date: Tue, 5 Feb 2013 17:19:14 +0000 (+0100) Subject: crypto: user - fix empty string test in report API X-Git-Tag: v3.9-rc1~87^2~1 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=e336ed9647b06e3bb52995dbc51101cbdf39f2a2;p=~emulex%2Finfiniband.git crypto: user - fix empty string test in report API The current test for empty strings fails because it is testing the address of a field, not a pointer. So the test will always be true. Test the first character in the string to not be null instead. Signed-off-by: Mathias Krause Cc: Steffen Klassert Signed-off-by: Herbert Xu --- diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index f6d9baf77f0..423a267022f 100644 --- a/crypto/crypto_user.c +++ b/crypto/crypto_user.c @@ -196,7 +196,7 @@ static int crypto_report(struct sk_buff *in_skb, struct nlmsghdr *in_nlh, struct crypto_dump_info info; int err; - if (!p->cru_driver_name) + if (!p->cru_driver_name[0]) return -EINVAL; alg = crypto_alg_match(p, 1);