kernel: ltq-tapi: add patch fixing compilation warning
[openwrt/openwrt.git] / package / kernel / lantiq / ltq-tapi / patches / 601-fix-compilation-warning-ret-not-handled.patch
diff --git a/package/kernel/lantiq/ltq-tapi/patches/601-fix-compilation-warning-ret-not-handled.patch b/package/kernel/lantiq/ltq-tapi/patches/601-fix-compilation-warning-ret-not-handled.patch
new file mode 100644 (file)
index 0000000..b97ced3
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/drv_tapi_ioctl.c
++++ b/src/drv_tapi_ioctl.c
+@@ -702,7 +702,8 @@ static IFX_int32_t TAPI_IoctlDev (IFX_TAPI_DRV_CTX_t* pDrvCtx,
+                if (ret == TAPI_statusOk || ret == 1)
+                {
+-                  copy_to_user ((IFX_void_t*)ioarg, p_tmp, sizeof(IFX_TAPI_CAP_t));
++                  if (copy_to_user ((IFX_void_t*)ioarg, p_tmp, sizeof(IFX_TAPI_CAP_t)))
++                     ret = TAPI_statusErrKernCpy;
+                }
+             }
+             TAPI_OS_Free (p_tmp);