File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -657,10 +657,10 @@ static struct kmemleak_object *__alloc_object(gfp_t gfp)
657
657
/* task information */
658
658
if (in_hardirq ()) {
659
659
object -> pid = 0 ;
660
- strncpy (object -> comm , "hardirq" , sizeof ( object -> comm ) );
660
+ strscpy (object -> comm , "hardirq" );
661
661
} else if (in_serving_softirq ()) {
662
662
object -> pid = 0 ;
663
- strncpy (object -> comm , "softirq" , sizeof ( object -> comm ) );
663
+ strscpy (object -> comm , "softirq" );
664
664
} else {
665
665
object -> pid = current -> pid ;
666
666
/*
@@ -669,7 +669,7 @@ static struct kmemleak_object *__alloc_object(gfp_t gfp)
669
669
* dependency issues with current->alloc_lock. In the worst
670
670
* case, the command line is not correct.
671
671
*/
672
- strncpy (object -> comm , current -> comm , sizeof ( object -> comm ) );
672
+ strscpy (object -> comm , current -> comm );
673
673
}
674
674
675
675
/* kernel backtrace */
You can’t perform that action at this time.
0 commit comments