diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c
index d015eff0c896361e3d1c80df82e8e7807ab2475f..98c15fe8bfddf63f71199e9093cc53b2b45b229d 100644
--- a/lustre/obdclass/genops.c
+++ b/lustre/obdclass/genops.c
@@ -317,7 +317,7 @@ struct obd_device *class_newdev(const char *type_name, const char *name)
                         new_obd_minor = i;
                         result->obd_type = type;
                         strncpy(result->obd_name, name,
-                                sizeof(result->obd_name));
+                                sizeof(result->obd_name) - 1);
                         obd_devs[i] = result;
                 }
         }