Skip to content

Commit 352ff3f

Browse files
ISCAS-Vulabmchehab
authored andcommitted
media: atomisp: Remove unneeded null check
In ia_css_frame_map, the check of 'err' is unneeded to be done twice. Link: https://lore.kernel.org/linux-media/20211110094910.67951-1-vulab@iscas.ac.cn Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent b467d97 commit 352ff3f

1 file changed

Lines changed: 15 additions & 17 deletions

File tree

  • drivers/staging/media/atomisp/pci/runtime/frame/src

‎drivers/staging/media/atomisp/pci/runtime/frame/src/frame.c‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -168,25 +168,23 @@ int ia_css_frame_map(struct ia_css_frame **frame,
168168
if (err)
169169
return err;
170170

171-
if (!err) {
172-
if (pgnr < ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
173-
dev_err(atomisp_dev,
174-
"user space memory size is less than the expected size..\n");
175-
err = -ENOMEM;
176-
goto error;
177-
} else if (pgnr > ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
178-
dev_err(atomisp_dev,
179-
"user space memory size is large than the expected size..\n");
180-
err = -ENOMEM;
181-
goto error;
182-
}
171+
if (pgnr < ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
172+
dev_err(atomisp_dev,
173+
"user space memory size is less than the expected size..\n");
174+
err = -ENOMEM;
175+
goto error;
176+
} else if (pgnr > ((PAGE_ALIGN(me->data_bytes)) >> PAGE_SHIFT)) {
177+
dev_err(atomisp_dev,
178+
"user space memory size is large than the expected size..\n");
179+
err = -ENOMEM;
180+
goto error;
181+
}
183182

184-
me->data = hmm_alloc(me->data_bytes, HMM_BO_USER, 0, data,
185-
attribute & ATOMISP_MAP_FLAG_CACHED);
183+
me->data = hmm_alloc(me->data_bytes, HMM_BO_USER, 0, data,
184+
attribute & ATOMISP_MAP_FLAG_CACHED);
186185

187-
if (me->data == mmgr_NULL)
188-
err = -EINVAL;
189-
}
186+
if (me->data == mmgr_NULL)
187+
err = -EINVAL;
190188

191189
error:
192190
if (err) {

0 commit comments

Comments
 (0)