diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index c95a874beb..93575d89c4 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -133,7 +133,6 @@ class LogFilterShowOnce(logging.Filter):
         self.seen_errors = set()
 
     def filter(self, record):
-        msg = record.msg
         if record.levelno == bb.msg.BBLogFormatter.WARNONCE:
             if record.msg in self.seen_warnings:
                 return False
