diff mbox

[2/6] RTC: Fix unused result warnings in RTC driver

Message ID 20141209162423.27831.515.stgit@hegdevasant.in.ibm.com
State Accepted, archived
Headers show

Commit Message

Vasant Hegde Dec. 9, 2014, 4:24 p.m. UTC
From: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

Fix Wunused-result

Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/fsp/fsp-rtc.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/hw/fsp/fsp-rtc.c b/hw/fsp/fsp-rtc.c
index 704648e..f60d2f3 100644
--- a/hw/fsp/fsp-rtc.c
+++ b/hw/fsp/fsp-rtc.c
@@ -457,8 +457,17 @@  static void rtc_flush_cached_tod(void)
 		return;
 	msg = fsp_mkmsg(FSP_CMD_WRITE_TOD, 3, y_m_d,
 			(h_m_s_m >> 32) & 0xffffff00, 0);
-	if (msg)
-		fsp_queue_msg(msg, fsp_freemsg);
+	if (!msg) {
+		prerror("TPO: %s : Failed to allocate write TOD message\n",
+			__func__);
+		return;
+	}
+	if (fsp_queue_msg(msg, fsp_freemsg)) {
+		fsp_freemsg(msg);
+		prerror("TPO: %s : Failed to queue WRITE_TOD command\n",
+			__func__);
+		return;
+	}
 }
 
 static bool fsp_rtc_msg_rr(u32 cmd_sub_mod, struct fsp_msg *msg)