[bug report] lib/kobject.c: use kvasprintf_const for formatting ->name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Rasmus Villemoes,

This is a semi-automatic email about new static checker warnings.

The patch f773f32d71a4: "lib/kobject.c: use kvasprintf_const for
formatting ->name" from Nov 6, 2015, leads to the following Smatch
complaint:

    lib/kobject.c:262 kobject_set_name_vargs()
     error: we previously assumed 'fmt' could be null (see line 259)

lib/kobject.c
   258	
   259		if (kobj->name && !fmt)
                                   ^^^
   260			return 0;
   261	
   262		s = kvasprintf_const(GFP_KERNEL, fmt, vargs);
                                                 ^^^

This warning is really old, and I suddenly have a lot of them today.

I'm always dorking with Smatch so my version is never the released
version or even the same as the day before.  I haven't figured out why
I have so many of these warnings now.  But this looks like a legit
issue.

I think this a bug in Smatch, but we could change the check to if (!fmt)?

   263		if (!s)
   264			return -ENOMEM;

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux