staging: r8188eu: propagate error code in rtw_p2p_get2
authorAbdun Nihaal <abdun.nihaal@gmail.com>
Sat, 29 Jan 2022 16:28:01 +0000 (21:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Jan 2022 13:02:47 +0000 (14:02 +0100)
rtw_p2p_get2 calls functions that can fail with -EFAULT.
Return the error code from the called functions.

Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Link: https://lore.kernel.org/r/818aad89738b66942bb66568081f1953a9494078.1643466748.git.abdun.nihaal@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/os_dep/ioctl_linux.c

index 35f7ba66a7cf430a7616208164ff4cb3510ee672..99c7f9369d2affaba12761418a2d710a5ee6688b 100644 (file)
@@ -3452,19 +3452,19 @@ static int rtw_p2p_get2(struct net_device *dev,
        DBG_88E("[%s] extra = %s\n", __func__, (char *)wrqu->data.pointer);
        if (!memcmp(extra, "wpsCM =", 6)) {
                wrqu->data.length -= 6;
-               rtw_p2p_get_wps_configmethod(dev, info, wrqu,  &extra[6]);
+               ret = rtw_p2p_get_wps_configmethod(dev, info, wrqu,  &extra[6]);
        } else if (!memcmp(extra, "devN =", 5)) {
                wrqu->data.length -= 5;
-               rtw_p2p_get_device_name(dev, info, wrqu, &extra[5]);
+               ret = rtw_p2p_get_device_name(dev, info, wrqu, &extra[5]);
        } else if (!memcmp(extra, "dev_type =", 9)) {
                wrqu->data.length -= 9;
-               rtw_p2p_get_device_type(dev, info, wrqu, &extra[9]);
+               ret = rtw_p2p_get_device_type(dev, info, wrqu, &extra[9]);
        } else if (!memcmp(extra, "go_devadd =", 10)) {
                wrqu->data.length -= 10;
-               rtw_p2p_get_go_device_address(dev, info, wrqu, &extra[10]);
+               ret = rtw_p2p_get_go_device_address(dev, info, wrqu, &extra[10]);
        } else if (!memcmp(extra, "InvProc =", 8)) {
                wrqu->data.length -= 8;
-               rtw_p2p_get_invitation_procedure(dev, info, wrqu, &extra[8]);
+               ret = rtw_p2p_get_invitation_procedure(dev, info, wrqu, &extra[8]);
        }
 
        return ret;