9 Dec
2022
9 Dec
'22
9:42 a.m.
Hi,
On Thu, 8 Dec 2022, Amadeusz Sławiński wrote:
On 12/8/2022 4:43 PM, Kai Vehmanen wrote:
@@ -2879,9 +2879,28 @@ static int i915_hsw_setup_stream(struct hda_codec *codec, hda_nid_t cvt_nid, hda_nid_t pin_nid, int dev_id, u32 stream_tag, int format) {
- struct hdmi_spec *spec = codec->spec;
- int pin_idx = pin_id_to_pin_index(codec, pin_nid, dev_id);
Shouldn't return value from pin_id_to_pin_index() be checked? It seems that it can return -EINVAL.
that's a good point. I think we are safe with current code as setup_stream ops is only called from generic_hdmi_playback_pcm_prepare() and spec->ops.setup_stream() there is only called with a valid pin. But this leaves room for future errors, and passing negative index to get_pin() is pretty bad. Let me send a V2 later today.
Thanks for the review!
Br, Kai