[bug report] locking/locktorture: Fix num reader/writer corner cases

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

 



Hello Davidlohr Bueso,

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

The patch 2b8ae38e13f1: "locking/locktorture: Fix num reader/writer 
corner cases" from May 15, 2017, leads to the following Smatch 
complaint:

    kernel/locking/locktorture.c:711 __torture_print_stats()
     error: we previously assumed 'statp' could be null (see line 706)

kernel/locking/locktorture.c
   705		int i, n_stress;
   706		long max = 0, min = statp ? statp[0].n_lock_acquired : 0;
                                    ^^^^^^^
Patch adds a check for NULL.

   707		long long sum = 0;
   708	
   709		n_stress = write ? cxt.nrealwriters_stress : cxt.nrealreaders_stress;
   710		for (i = 0; i < n_stress; i++) {
   711			if (statp[i].n_lock_fail)
                            ^^^^^^^^
Can this be NULL here?

   712				fail = true;
   713			sum += statp[i].n_lock_acquired;

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