---
 drivers/net/qede/base/ecore_int.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/base/ecore_int.c 
b/drivers/net/qede/base/ecore_int.c
index f43781ba4..c809d84ef 100644
--- a/drivers/net/qede/base/ecore_int.c
+++ b/drivers/net/qede/base/ecore_int.c
@@ -1103,10 +1103,12 @@ static enum _ecore_status_t 
ecore_int_deassertion(struct ecore_hwfn *p_hwfn,
                                                OSAL_SNPRINTF(bit_name, 30,
                                                              p_aeu->bit_name,
                                                              num);
-                                       else
-                                               OSAL_STRNCPY(bit_name,
-                                                            p_aeu->bit_name,
-                                                            30);
+                                       else {
+                                               strncpy(bit_name,
+                                                       p_aeu->bit_name,
+                                                       sizeof(bit_name) - 1);
+                                               bit_name[sizeof(bit_name) - 1] 
= '\0';
+                                       }
 
                                        /* We now need to pass bitmask in its
                                         * correct position.

Reply via email to