CC: [email protected]
CC: [email protected]
TO: Julian Braha <[email protected]>
CC: Andrew Morton <[email protected]>
CC: Linux Memory Management List <[email protected]>

Hi Julian,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   ecf93431963a95c0f475921101bedc0dd62ec96d
commit: 7d37cb2c912dc5c25ffac784a4f9b98c06c6bd08 lib: fix kconfig dependency on 
ARCH_WANT_FRAME_POINTERS
date:   4 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 4 months ago
compiler: csky-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/opp/core.c:1009:3: warning: Possible null pointer dereference: opp 
>> [nullPointer]
     opp->level, old_opp->bandwidth ? old_opp->bandwidth[0].peak : 0,
     ^
   drivers/opp/core.c:1085:27: note: Assignment 'opp=NULL', assigned value is 0
    struct dev_pm_opp *opp = NULL;
                             ^
   drivers/opp/core.c:1126:33: note: Calling function '_set_opp', 3rd argument 
'opp' value is 0
    ret = _set_opp(dev, opp_table, opp, freq);
                                   ^
   drivers/opp/core.c:1009:3: note: Null pointer dereference
     opp->level, old_opp->bandwidth ? old_opp->bandwidth[0].peak : 0,
     ^
   drivers/opp/core.c:1010:3: warning: Possible null pointer dereference: opp 
[nullPointer]
     opp->bandwidth ? opp->bandwidth[0].peak : 0);
     ^
   drivers/opp/core.c:1085:27: note: Assignment 'opp=NULL', assigned value is 0
    struct dev_pm_opp *opp = NULL;
                             ^
   drivers/opp/core.c:1126:33: note: Calling function '_set_opp', 3rd argument 
'opp' value is 0
    ret = _set_opp(dev, opp_table, opp, freq);
                                   ^
   drivers/opp/core.c:1010:3: note: Null pointer dereference
     opp->bandwidth ? opp->bandwidth[0].peak : 0);
     ^
>> drivers/opp/core.c:1621:20: warning: Possible null pointer dereference: opp2 
>> [nullPointer]
    if (opp1->rate != opp2->rate)
                      ^
   drivers/opp/core.c:1085:27: note: Assignment 'opp=NULL', assigned value is 0
    struct dev_pm_opp *opp = NULL;
                             ^
   drivers/opp/core.c:1126:33: note: Calling function '_set_opp', 3rd argument 
'opp' value is 0
    ret = _set_opp(dev, opp_table, opp, freq);
                                   ^
   drivers/opp/core.c:1012:43: note: Calling function '_opp_compare_key', 2nd 
argument 'opp' value is 0
    scaling_down = _opp_compare_key(old_opp, opp);
                                             ^
   drivers/opp/core.c:1621:20: note: Null pointer dereference
    if (opp1->rate != opp2->rate)
                      ^
   drivers/opp/core.c:1626:21: warning: Possible null pointer dereference: opp2 
[nullPointer]
    if (opp1->level != opp2->level)
                       ^
   drivers/opp/core.c:1085:27: note: Assignment 'opp=NULL', assigned value is 0
    struct dev_pm_opp *opp = NULL;
                             ^
   drivers/opp/core.c:1126:33: note: Calling function '_set_opp', 3rd argument 
'opp' value is 0
    ret = _set_opp(dev, opp_table, opp, freq);
                                   ^
   drivers/opp/core.c:1012:43: note: Calling function '_opp_compare_key', 2nd 
argument 'opp' value is 0
    scaling_down = _opp_compare_key(old_opp, opp);
                                             ^
   drivers/opp/core.c:1626:21: note: Null pointer dereference
    if (opp1->level != opp2->level)
                       ^
>> drivers/opp/core.c:1649:4: warning: Address of local auto-variable assigned 
>> to a function parameter. [autoVariables]
      *head = &opp->node;
      ^

vim +1009 drivers/opp/core.c

f3364e17d5716a drivers/opp/core.c            Viresh Kumar    2020-08-13   984  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21   985  
static int _set_opp(struct device *dev, struct opp_table *opp_table,
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21   986   
            struct dev_pm_opp *opp, unsigned long freq)
6a0712f6f199e7 drivers/base/power/opp/core.c Viresh Kumar    2016-02-09   987  {
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21   988   
struct dev_pm_opp *old_opp;
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21   989   
int scaling_down, ret;
6a0712f6f199e7 drivers/base/power/opp/core.c Viresh Kumar    2016-02-09   990  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21   991   
if (unlikely(!opp))
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21   992   
        return _disable_opp_table(dev, opp_table);
aca48b61f96386 drivers/opp/core.c            Rajendra Nayak  2020-04-08   993  
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20   994   
/* Find the currently set OPP if we don't know already */
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20   995   
if (unlikely(!opp_table->current_opp))
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20   996   
        _find_current_opp(dev, opp_table);
6a0712f6f199e7 drivers/base/power/opp/core.c Viresh Kumar    2016-02-09   997  
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20   998   
old_opp = opp_table->current_opp;
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20   999  
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20  1000   
/* Return early if nothing to do */
de04241ab87afc drivers/opp/core.c            Jonathan Marek  2021-02-16  1001   
if (old_opp == opp && opp_table->current_rate == freq &&
de04241ab87afc drivers/opp/core.c            Jonathan Marek  2021-02-16  1002   
    opp_table->enabled) {
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20  1003   
        dev_dbg(dev, "%s: OPPs are same, nothing to do\n", __func__);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21  1004   
        return 0;
6a0712f6f199e7 drivers/base/power/opp/core.c Viresh Kumar    2016-02-09  1005   
}
6a0712f6f199e7 drivers/base/power/opp/core.c Viresh Kumar    2016-02-09  1006  
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21  1007   
dev_dbg(dev, "%s: switching OPP: Freq %lu -> %lu Hz, Level %u -> %u, Bw %u -> 
%u\n",
de04241ab87afc drivers/opp/core.c            Jonathan Marek  2021-02-16  1008   
        __func__, opp_table->current_rate, freq, old_opp->level,
de04241ab87afc drivers/opp/core.c            Jonathan Marek  2021-02-16 @1009   
        opp->level, old_opp->bandwidth ? old_opp->bandwidth[0].peak : 0,
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21  1010   
        opp->bandwidth ? opp->bandwidth[0].peak : 0);
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21  1011  
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21  1012   
scaling_down = _opp_compare_key(old_opp, opp);
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21  1013   
if (scaling_down == -1)
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21  1014   
        scaling_down = 0;
947355850fcb3b drivers/base/power/opp/core.c Viresh Kumar    2016-12-01  1015  
ca1b5d77b1c69d drivers/opp/core.c            Viresh Kumar    2018-06-14  1016   
/* Scaling up? Configure required OPPs before frequency */
f0b88fa4559525 drivers/opp/core.c            Viresh Kumar    2021-01-21  1017   
if (!scaling_down) {
2c59138c22f17c drivers/opp/core.c            Stephan Gerhold 2020-07-30  1018   
        ret = _set_required_opps(dev, opp_table, opp, true);
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1019   
        if (ret) {
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1020   
                dev_err(dev, "Failed to set required opps: %d\n", ret);
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21  1021   
                return ret;
ca1b5d77b1c69d drivers/opp/core.c            Viresh Kumar    2018-06-14  1022   
        }
ca1b5d77b1c69d drivers/opp/core.c            Viresh Kumar    2018-06-14  1023  
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1024   
        ret = _set_opp_bw(opp_table, opp, dev);
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1025   
        if (ret) {
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1026   
                dev_err(dev, "Failed to set bw: %d\n", ret);
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1027   
                return ret;
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1028   
        }
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1029   
}
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1030  
7e535993fa4f67 drivers/opp/core.c            Viresh Kumar    2018-06-12  1031   
if (opp_table->set_opp) {
509e4777ca41d3 drivers/opp/core.c            Viresh Kumar    2021-01-21  1032   
        ret = _set_opp_custom(opp_table, dev, opp, freq);
7e535993fa4f67 drivers/opp/core.c            Viresh Kumar    2018-06-12  1033   
} else if (opp_table->regulators) {
3f62670fcca4af drivers/opp/core.c            Viresh Kumar    2021-01-21  1034   
        ret = _generic_set_opp_regulator(opp_table, dev, opp, freq,
3f62670fcca4af drivers/opp/core.c            Viresh Kumar    2021-01-21  1035   
                                         scaling_down);
c74b32fadc00f2 drivers/base/power/opp/core.c Viresh Kumar    2017-05-23  1036   
} else {
947355850fcb3b drivers/base/power/opp/core.c Viresh Kumar    2016-12-01  1037   
        /* Only frequency scaling */
1d3c42cabbd351 drivers/opp/core.c            Viresh Kumar    2021-01-20  1038   
        ret = _generic_set_opp_clk_only(dev, opp_table->clk, freq);
c74b32fadc00f2 drivers/base/power/opp/core.c Viresh Kumar    2017-05-23  1039   
}
6a0712f6f199e7 drivers/base/power/opp/core.c Viresh Kumar    2016-02-09  1040  
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1041   
if (ret)
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1042   
        return ret;
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1043  
ca1b5d77b1c69d drivers/opp/core.c            Viresh Kumar    2018-06-14  1044   
/* Scaling down? Configure required OPPs after frequency */
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1045   
if (scaling_down) {
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1046   
        ret = _set_opp_bw(opp_table, opp, dev);
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1047   
        if (ret) {
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1048   
                dev_err(dev, "Failed to set bw: %d\n", ret);
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1049   
                return ret;
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1050   
        }
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1051  
2c59138c22f17c drivers/opp/core.c            Stephan Gerhold 2020-07-30  1052   
        ret = _set_required_opps(dev, opp_table, opp, false);
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1053   
        if (ret) {
ca1b5d77b1c69d drivers/opp/core.c            Viresh Kumar    2018-06-14  1054   
                dev_err(dev, "Failed to set required opps: %d\n", ret);
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1055   
                return ret;
870d5d963972dd drivers/opp/core.c            Viresh Kumar    2021-01-28  1056   
        }
c74b32fadc00f2 drivers/base/power/opp/core.c Viresh Kumar    2017-05-23  1057   
}
052c6f19141dd1 drivers/base/power/opp/core.c Viresh Kumar    2017-01-23  1058  
72f80ce4ef9b75 drivers/opp/core.c            Viresh Kumar    2020-08-13  1059   
opp_table->enabled = true;
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20  1060   
dev_pm_opp_put(old_opp);
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20  1061  
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20  1062   
/* Make sure current_opp doesn't get freed */
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20  1063   
dev_pm_opp_get(opp);
81c4d8a3c41488 drivers/opp/core.c            Viresh Kumar    2021-01-20  1064   
opp_table->current_opp = opp;
de04241ab87afc drivers/opp/core.c            Jonathan Marek  2021-02-16  1065   
opp_table->current_rate = freq;
fe2af40250bfc3 drivers/opp/core.c            Georgi Djakov   2020-05-12  1066  
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21  1067   
return ret;
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21  1068  }
386ba854d9f316 drivers/opp/core.c            Viresh Kumar    2021-01-21  1069  

:::::: The code at line 1009 was first introduced by commit
:::::: de04241ab87afcaac26f15fcc32a7bd27294dd47 opp: Don't skip freq update for 
different frequency

:::::: TO: Jonathan Marek <[email protected]>
:::::: CC: Viresh Kumar <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to