Messages in this thread | | | Subject | Re: [PATCH] tracing: Do PTR_ERR() after IS_ERR() | From | liqiong <> | Date | Thu, 28 Jul 2022 08:28:08 +0800 |
| |
在 2022年07月28日 00:28, Steven Rostedt 写道: > On Wed, 27 Jul 2022 23:35:19 +0800 > Li Qiong <liqiong@nfschina.com> wrote: > >> Check IS_ERR() firstly, then do PTR_ERR(). > Why? > > The code is fine as is. > > -- Steve >
Hi,
It's all right, assign PTR_ERR() to 'ret' anyway. But this assignment is valid only at the "IS_ERR()" path. Maybe it is better put "PTR_ERR()" at error path, keep the code clear.
-- 李力琼 <13524287433> 上海市浦东新区海科路99号中科院上海高等研究院3号楼3楼
| |