[WCNCR00164618] misc: Fix CoreDump crash in kernel 4.4

[Description]
Fix CoreDump crash in kernel 4.4

[Repeat steps]
1. Trigger N9 coredump
2. Get following kernel oops

[ 1024.073088] [DUMP_N9]====N9 ASSERT_DUMPSTART====
[ 1024.073210] kernel tried to execute NX-protected page - exploit attempt?
[ 1024.073242] BUG: unable to handle kernel NULL pointer dereference at
[ 1024.073269] IP: [<  (null)>]   (null)
........
[ 1024.074192] Call Trace:
[ 1024.074294]  [<faf521fe>] ? kalWriteCorDumpFile+0x3e/0x60
[ 1024.074390]  [<faf46b36>] nicEventAssertDump+0x236/0x3e0
[ 1024.074480]  [<faf356c8>] nicRxProcessEventPacket+0x58/0x280
........

[Rootcause]
"f_op->write" is a Null pointer in this case. The other possible
option is "f_op->write_iter"

Descriptions of these two methods in vfs.txt as below:
* write: called by write(2) and related system calls
* write_iter: possibly asynchronous write with iov_iter as source

[Solution]
Direct access "f_op->write" is not recommended. It's better to use
vfs_write() for file-writing in kernel space. Update related API usage to
kalWriteToFile() searials.

Change-Id: I5deb1523929884dd9ac0a521487b44d0a3af4e02
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
CR-Id: WCNCR00164618
Feature: misc
(cherry picked from commit 9d8660ee6af0af3e69a8fb908e3ad02df95f7432)
1 file changed