Fix scan-build warning (null use).

Probably false positive but defensive approach is better here.
This commit is contained in:
Milan Broz
2014-08-10 16:06:21 +02:00
parent f3f1bfd73a
commit e84b1ed7c0

View File

@@ -187,6 +187,9 @@ static int crypt_cipher_crypt(struct crypt_cipher *ctx,
/* Set encrypt/decrypt operation */
header = CMSG_FIRSTHDR(&msg);
if (!header)
return -EINVAL;
header->cmsg_level = SOL_ALG;
header->cmsg_type = ALG_SET_OP;
header->cmsg_len = CMSG_LEN(sizeof(*type));