* [PATCH -next] media: staging/intel-ipu3: Fix err handle of ipu3_css_find_binary
@ 2018-12-29 2:45 YueHaibing
2019-01-07 2:38 ` Bingbu Cao
0 siblings, 1 reply; 4+ messages in thread
From: YueHaibing @ 2018-12-29 2:45 UTC (permalink / raw)
To: sakari.ailus, mchehab, gregkh
Cc: linux-kernel, devel, linux-media, YueHaibing
'bindex' is unsigned, it never less than zero.
This patch bring int 'binary' back to handle the err condition.
Fixes: 51abe041c5ed ("media: staging/intel-ipu3: Add dual pipe support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/staging/media/ipu3/ipu3-css.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/ipu3/ipu3-css.c b/drivers/staging/media/ipu3/ipu3-css.c
index 44c5563..28f0c02 100644
--- a/drivers/staging/media/ipu3/ipu3-css.c
+++ b/drivers/staging/media/ipu3/ipu3-css.c
@@ -1751,7 +1751,7 @@ int ipu3_css_fmt_try(struct ipu3_css *css,
&q[IPU3_CSS_QUEUE_OUT].fmt.mpix;
struct v4l2_pix_format_mplane *const vf =
&q[IPU3_CSS_QUEUE_VF].fmt.mpix;
- int i, s;
+ int i, s, binary;
/* Adjust all formats, get statistics buffer sizes and formats */
for (i = 0; i < IPU3_CSS_QUEUES; i++) {
@@ -1826,13 +1826,13 @@ int ipu3_css_fmt_try(struct ipu3_css *css,
s = (bds->height - gdc->height) / 2 - FILTER_SIZE;
env->height = s < MIN_ENVELOPE ? MIN_ENVELOPE : s;
- css->pipes[pipe].bindex =
- ipu3_css_find_binary(css, pipe, q, r);
- if (css->pipes[pipe].bindex < 0) {
+ binary = ipu3_css_find_binary(css, pipe, q, r);
+ if (binary < 0) {
dev_err(css->dev, "failed to find suitable binary\n");
return -EINVAL;
}
+ css->pipes[pipe].bindex = binary;
dev_dbg(css->dev, "Binary index %d for pipe %d found.",
css->pipes[pipe].bindex, pipe);
--
2.7.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] media: staging/intel-ipu3: Fix err handle of ipu3_css_find_binary
2018-12-29 2:45 [PATCH -next] media: staging/intel-ipu3: Fix err handle of ipu3_css_find_binary YueHaibing
@ 2019-01-07 2:38 ` Bingbu Cao
2019-01-07 11:00 ` Sakari Ailus
0 siblings, 1 reply; 4+ messages in thread
From: Bingbu Cao @ 2019-01-07 2:38 UTC (permalink / raw)
To: YueHaibing, sakari.ailus, mchehab, gregkh
Cc: linux-kernel, devel, linux-media
Hi, Haibing
Thanks for your patch, it looks fine for me.
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
On 12/29/2018 10:45 AM, YueHaibing wrote:
> css->pipes[pipe].bindex = binary;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] media: staging/intel-ipu3: Fix err handle of ipu3_css_find_binary
2019-01-07 2:38 ` Bingbu Cao
@ 2019-01-07 11:00 ` Sakari Ailus
2019-01-08 4:10 ` Bingbu Cao
0 siblings, 1 reply; 4+ messages in thread
From: Sakari Ailus @ 2019-01-07 11:00 UTC (permalink / raw)
To: Bingbu Cao; +Cc: YueHaibing, mchehab, gregkh, linux-kernel, devel, linux-media
Hi Bingbu,
On Mon, Jan 07, 2019 at 10:38:19AM +0800, Bingbu Cao wrote:
> Hi, Haibing
>
> Thanks for your patch, it looks fine for me.
> Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
>
> On 12/29/2018 10:45 AM, YueHaibing wrote:
> > css->pipes[pipe].bindex = binary;
I'm taking Colin's patch with equivalent content; it was there first.
Thanks!
--
Sakari Ailus
sakari.ailus@linux.intel.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] media: staging/intel-ipu3: Fix err handle of ipu3_css_find_binary
2019-01-07 11:00 ` Sakari Ailus
@ 2019-01-08 4:10 ` Bingbu Cao
0 siblings, 0 replies; 4+ messages in thread
From: Bingbu Cao @ 2019-01-08 4:10 UTC (permalink / raw)
To: Sakari Ailus
Cc: YueHaibing, mchehab, gregkh, linux-kernel, devel, linux-media
On 01/07/2019 07:00 PM, Sakari Ailus wrote:
> Hi Bingbu,
>
> On Mon, Jan 07, 2019 at 10:38:19AM +0800, Bingbu Cao wrote:
>> Hi, Haibing
>>
>> Thanks for your patch, it looks fine for me.
>> Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
>>
>> On 12/29/2018 10:45 AM, YueHaibing wrote:
>>> css->pipes[pipe].bindex = binary;
> I'm taking Colin's patch with equivalent content; it was there first.
Sakari, good to know that, thanks!
>
> Thanks!
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-08 4:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29 2:45 [PATCH -next] media: staging/intel-ipu3: Fix err handle of ipu3_css_find_binary YueHaibing
2019-01-07 2:38 ` Bingbu Cao
2019-01-07 11:00 ` Sakari Ailus
2019-01-08 4:10 ` Bingbu Cao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).