summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/flash/phosphor-software-manager/0011-Fix-for-RedudancyPriority-in-item_updater.patch
blob: 156e6fe7c0cbf1ec542781aeea5eb1eefa3571ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From f6022e25d0b47af502522913773e589fcdd1568e Mon Sep 17 00:00:00 2001
From: Vikram Bodireddy <vikram.bodireddy@intel.com>
Date: Sun, 5 Jul 2020 00:54:57 +0530
Subject: [PATCH] Fix for RedudancyPriority in item_updater

This fixes accessing RedudancyPriority property for the
activated image in item_updater. The downloaded image object
is not actually associated with RedudancyPriority before and
after activation. There exists no RedundancyPriority property
for downloaded image, accessing it causing a crash in
item_updater.

Tested: Tested for coredumps during Seamless firmware update.

Signed-off-by: Vikram Bodireddy <vikram.bodireddy@intel.com>

---
 item_updater.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/item_updater.cpp b/item_updater.cpp
index c3a846d..b299b4d 100644
--- a/item_updater.cpp
+++ b/item_updater.cpp
@@ -690,8 +690,9 @@ void ItemUpdater::freeSpace(Activation& caller)
             // Failed activations don't have priority, assign them a large value
             // for sorting purposes.
             auto priority = 999;
-            if (iter.second.get()->activation() ==
-                server::Activation::Activations::Active)
+             if ((iter.second.get()->activation() ==
+                server::Activation::Activations::Active)&&
+                iter.second->redundancyPriority.get())
             {
                 priority = iter.second->redundancyPriority.get()->priority();
             }