[tip: x86/sev] virt: sevguest: Fix bool function returning negative value

From: tip-bot2 for Haowen Bai
Date: Thu Apr 14 2022 - 08:02:03 EST


The following commit has been merged into the x86/sev branch of tip:

Commit-ID: 101826e02ac6c829bf4e768295e79ae9c37b4b2a
Gitweb: https://git.kernel.org/tip/101826e02ac6c829bf4e768295e79ae9c37b4b2a
Author: Haowen Bai <baihaowen@xxxxxxxxx>
AuthorDate: Thu, 14 Apr 2022 18:04:17 +08:00
Committer: Borislav Petkov <bp@xxxxxxx>
CommitterDate: Thu, 14 Apr 2022 13:53:35 +02:00

virt: sevguest: Fix bool function returning negative value

The function enc_payload() is wrongly declared bool but returns an
integer value. Correct it.

[ bp: Massage commit message. ]

Fixes: fce96cf04430 ("virt: Add SEV-SNP guest driver")
Signed-off-by: Haowen Bai <baihaowen@xxxxxxxxx>
Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Link: https://lore.kernel.org/r/1649930657-10837-1-git-send-email-baihaowen@xxxxxxxxx
---
drivers/virt/coco/sevguest/sevguest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/virt/coco/sevguest/sevguest.c b/drivers/virt/coco/sevguest/sevguest.c
index aaa6134..15f069e 100644
--- a/drivers/virt/coco/sevguest/sevguest.c
+++ b/drivers/virt/coco/sevguest/sevguest.c
@@ -276,7 +276,7 @@ static int verify_and_dec_payload(struct snp_guest_dev *snp_dev, void *payload,
return dec_payload(snp_dev, resp, payload, resp_hdr->msg_sz + crypto->a_len);
}

-static bool enc_payload(struct snp_guest_dev *snp_dev, u64 seqno, int version, u8 type,
+static int enc_payload(struct snp_guest_dev *snp_dev, u64 seqno, int version, u8 type,
void *payload, size_t sz)
{
struct snp_guest_msg *req = snp_dev->request;