Content-Type: multipart/mixed; boundary="===============4708391944440466295==" MIME-Version: 1.0 From: Julia Lawall To: kbuild-all@lists.01.org Subject: Re: [daniel.lezcano:thermal/linux-next 11/16] drivers/thermal/qcom/tsens.c:123:1-7: ERROR: missing put_device; call of_find_device_by_node on line 103, but without a corresponding object release within this function. (fwd) Date: Fri, 18 Oct 2019 14:33:06 +0200 Message-ID: In-Reply-To: List-Id: --===============4708391944440466295== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, 18 Oct 2019, Amit Kucheria wrote: > On Thu, Oct 17, 2019 at 3:54 PM Julia Lawall wro= te: > > > > Hello, > > > > Perhaps pdev should be released or save somewhere before leaving the > > function. > > > > If this is a false positive, I can update the rule. > > > > julia > > Thanks for the report, Julia. > > I believe the following patch fixes this issue. Can you confirm? It looks ok to me. julia > > Daniel, would you like me to respin the series with this fix squashed > or will you take this patch on top of thermal-next? > > Regards, > Amit > > > ---------- Forwarded message ---------- > > Date: Thu, 17 Oct 2019 18:06:41 +0800 > > From: kbuild test robot > > To: kbuild(a)lists.01.org > > Cc: Julia Lawall > > Subject: [daniel.lezcano:thermal/linux-next 11/16] > > drivers/thermal/qcom/tsens.c:123:1-7: ERROR: missing put_device; ca= ll > > of_find_device_by_node on line 103, > > but without a corresponding object release within this function. > > > > CC: kbuild-all(a)lists.01.org > > TO: Amit Kucheria > > CC: Daniel Lezcano > > CC: Stephen Boyd > > > > tree: http://git.linaro.org/people/daniel.lezcano/linux thermal/linux= -next > > head: 124d92b700811381a477ca6b38d1c98417894f0e > > commit: cd376943ac255b0b0b299307c12f6bdb28b825a2 [11/16] drivers: therm= al: tsens: Add interrupt support > > :::::: branch date: 16 hours ago > > :::::: commit date: 25 hours ago > > > > If you fix the issue, kindly add following tag > > Reported-by: kbuild test robot > > Reported-by: Julia Lawall > > > > >> drivers/thermal/qcom/tsens.c:123:1-7: ERROR: missing put_device; cal= l of_find_device_by_node on line 103, but without a corresponding object re= lease within this function. > > > > git remote add daniel.lezcano http://git.linaro.org/people/daniel.lezca= no/linux > > git remote update daniel.lezcano > > git checkout cd376943ac255b0b0b299307c12f6bdb28b825a2 > > vim +123 drivers/thermal/qcom/tsens.c > > > > 9066073c6c2799 Rajendra Nayak 2016-05-05 84 > > 69b628ac71f07d Amit Kucheria 2019-03-20 85 static int tsens_registe= r(struct tsens_priv *priv) > > 9066073c6c2799 Rajendra Nayak 2016-05-05 86 { > > cd376943ac255b Amit Kucheria 2019-10-16 87 int i, ret, irq; > > 9066073c6c2799 Rajendra Nayak 2016-05-05 88 struct thermal_zone_dev= ice *tzd; > > cd376943ac255b Amit Kucheria 2019-10-16 89 struct platform_device = *pdev; > > 9066073c6c2799 Rajendra Nayak 2016-05-05 90 > > 69b628ac71f07d Amit Kucheria 2019-03-20 91 for (i =3D 0; i < priv= ->num_sensors; i++) { > > 69b628ac71f07d Amit Kucheria 2019-03-20 92 priv->sensor[i]= .priv =3D priv; > > 3e68159d5fdf29 Amit Kucheria 2019-10-16 93 tzd =3D devm_th= ermal_zone_of_sensor_register(priv->dev, priv->sensor[i].hw_id, > > 69b628ac71f07d Amit Kucheria 2019-03-20 94 = &priv->sensor[i], > > 9066073c6c2799 Rajendra Nayak 2016-05-05 95 = &tsens_of_ops); > > 9066073c6c2799 Rajendra Nayak 2016-05-05 96 if (IS_ERR(tzd)) > > 9066073c6c2799 Rajendra Nayak 2016-05-05 97 continu= e; > > 69b628ac71f07d Amit Kucheria 2019-03-20 98 priv->sensor[i]= .tzd =3D tzd; > > 69b628ac71f07d Amit Kucheria 2019-03-20 99 if (priv->ops->= enable) > > 69b628ac71f07d Amit Kucheria 2019-03-20 100 priv->o= ps->enable(priv, i); > > 9066073c6c2799 Rajendra Nayak 2016-05-05 101 } > > cd376943ac255b Amit Kucheria 2019-10-16 102 > > cd376943ac255b Amit Kucheria 2019-10-16 @103 pdev =3D of_find_device= _by_node(priv->dev->of_node); > > cd376943ac255b Amit Kucheria 2019-10-16 104 if (!pdev) > > cd376943ac255b Amit Kucheria 2019-10-16 105 return -ENODEV; > > cd376943ac255b Amit Kucheria 2019-10-16 106 > > cd376943ac255b Amit Kucheria 2019-10-16 107 irq =3D platform_get_ir= q_byname(pdev, "uplow"); > > cd376943ac255b Amit Kucheria 2019-10-16 108 if (irq < 0) { > > cd376943ac255b Amit Kucheria 2019-10-16 109 ret =3D irq; > > cd376943ac255b Amit Kucheria 2019-10-16 110 goto err_put_de= vice; > > cd376943ac255b Amit Kucheria 2019-10-16 111 } > > cd376943ac255b Amit Kucheria 2019-10-16 112 > > cd376943ac255b Amit Kucheria 2019-10-16 113 ret =3D devm_request_th= readed_irq(&pdev->dev, irq, > > cd376943ac255b Amit Kucheria 2019-10-16 114 = NULL, tsens_irq_thread, > > cd376943ac255b Amit Kucheria 2019-10-16 115 = IRQF_TRIGGER_HIGH | IRQF_ONESHOT, > > cd376943ac255b Amit Kucheria 2019-10-16 116 = dev_name(&pdev->dev), priv); > > cd376943ac255b Amit Kucheria 2019-10-16 117 if (ret) { > > cd376943ac255b Amit Kucheria 2019-10-16 118 dev_err(&pdev->= dev, "%s: failed to get irq\n", __func__); > > cd376943ac255b Amit Kucheria 2019-10-16 119 goto err_put_de= vice; > > cd376943ac255b Amit Kucheria 2019-10-16 120 } > > cd376943ac255b Amit Kucheria 2019-10-16 121 > > cd376943ac255b Amit Kucheria 2019-10-16 122 enable_irq_wake(irq); > > 9066073c6c2799 Rajendra Nayak 2016-05-05 @123 return 0; > > cd376943ac255b Amit Kucheria 2019-10-16 124 > > cd376943ac255b Amit Kucheria 2019-10-16 125 err_put_device: > > cd376943ac255b Amit Kucheria 2019-10-16 126 put_device(&pdev->dev); > > cd376943ac255b Amit Kucheria 2019-10-16 127 return ret; > > 9066073c6c2799 Rajendra Nayak 2016-05-05 128 } > > 9066073c6c2799 Rajendra Nayak 2016-05-05 129 > > > > :::::: The code at line 123 was first introduced by commit > > :::::: 9066073c6c27994a30187abf3b674770b4088348 thermal: qcom: tsens: A= dd a skeletal TSENS drivers > > > > :::::: TO: Rajendra Nayak > > :::::: CC: Zhang Rui > > > > --- > > 0-DAY kernel test infrastructure Open Source Technology = Center > > https://lists.01.org/pipermail/kbuild-all Intel Corpo= ration > --===============4708391944440466295==--