Conversation
"If we couldn't ask the chip if OKC is supported, assume it is NOT supported and do not try to use it." This ensures that if any code later in the connection process checks if (profile->is_okc) ..., it will evaluate to false and skip OKC logic, preventing a potential second error where the driver tries to enable a feature the chip doesn't support. Signed-off-by: Murat Cyberfu <murat@cyberfu.co.uk>
|
This code is upstream and doesn't affect any of our downstream patches or Apple Silicon-specific drivers or functions. Please directly submit it upstream. |
|
|
|
Sorry about that, got confused with my branches and though that was upstream already! |
| if (err) { | ||
| bphy_err(drvr, "could not get wpa_auth (%d)\n", err); | ||
| return err; | ||
| profile->is_okc = false; // If we couldn't ask the chip if OKC is supported, assume it is NOT supported and do not try to use it |
There was a problem hiding this comment.
I don't see how profile->is_okc could be true at this point. It is explictly set to false just 8 llines above.
There was a problem hiding this comment.
The return must not be removed otherwise val might be used without initialization
| &okc_enable); | ||
| if (err) { | ||
| bphy_err(drvr, "get okc_enable failed (%d)\n", err); | ||
| profile->is_okc = false; // Again, set state so it does not try OKC if not allowed |
There was a problem hiding this comment.
again, I do not see how this could make a difference. profile->is_okc is set to false at the beginning of this function and the places there it might be set to true are the two profile->is_okc = okc_enable; after querying "okc_enable" in lin 1944 and 1956
jannau
left a comment
There was a problem hiding this comment.
I don't see how this change could make any difference except for using an uninitialized value. The original code looks ok to me.
"If we couldn't ask the chip if OKC is supported, assume it is NOT supported and do not try to use it."
This ensures that if any code later in the connection process checks if (profile->is_okc) ..., it will evaluate to false and skip OKC logic, preventing a potential second error where the driver tries to enable a feature the chip doesn't support.